Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Hi have Centos 6 installed and busy installing wkhtmltopdf, I only have one step left and that is to include extension=phpwkhtmltox.so to the php.ini file, I added it to /etc/php.ini and reloaded apache and the extention does not take effect.

I check /usr/lib64/php/modules/phpwkhtmltox.so and the file is present.

Is there anything I did wrong?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

When adding an extension to PHP:

  1. Ensure you adding it to the correct php.ini file:

    • Check the output of phpinfo(); for the 'Loaded Configuration File' line
      • see if you are actually using /etc/php.ini
    • Alternatively try: php -i | grep php.ini
      • some environments (e.g. FastCGI) may load a different config file, so this isn't always reliable

  2. php.ini is an INI file - it is divided into sections (with the section names in square brackets). A directive under the wrong section may not be correctly applied. You should add extensions to the '[PHP]' section (typically the first section, it is often followed by sections for 'Module Settings')

  3. PHP loads the ini files from /etc/php.d - it is good practise to add the extension from there. Create a new ini file, named after your module, containing the 'extension=' directive, and any module specific configuration options. For example:

echo "extension=phpwkhtmltox.so" > /etc/php.d/phpwkhtmltox.ini

Of course, restart Apache/PHP after you have made the changes, and confirm that they were successful using phpinfo();

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                  <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2015 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2015.7.7.2698\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </noscri"], "copyright__copyright__copyright": ["taining the 'extension=' directive, and any module specific configuration options. For example:\n\necho \"extension=phpwkhtmltox.so\" > /etc/php.d/phpwkhtmltox.ini\n\nOf course, restart Apache/PHP after you have made the changes, and confirm that they were successful using phpinfo();\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}