Question

I have added the following php.ini (this is 100% of file):

upload_max_filesize = 200M
post_max_size = 200M
session.gc_maxlifetime = 6000
max_execution_time = 600

When it is present the phpinfo() lists PDO in the configure command but nowhere else. The drivers, API version and SQLite version are all gone. I discovered this when queries started failing with "Class 'PDO' not found".

If I remove the php.ini I get different results, see below. This is on a shared server. How should I proceed? I absolutely must have the php.ini modifications.

PDO settings

Was it helpful?

Solution

If your ini file only contains those vars it will only override them and use the master values for the others but in most cases extensions like pdo, mysqli, mbstring, sqlite are disabled by default to save resources and most shared hostings nowadays let you enable them.

OTHER TIPS

I had the same problem. My solution was that in php.ini the line dictating the loadable extensions folder was incorrect.

I changed:

; Directory in which the loadable extensions (modules) reside.
extension_dir = "/home/mycmecre/public_html/php_extensions"
;extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"

to

; Directory in which the loadable extensions (modules) reside.
;extension_dir = "/home/mycmecre/public_html/php_extensions"
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"

and PDO magically loaded for me. Hope this helps someone, as it took me hours to figure out, and apparently longer for my web host tech support, as they have not called me back yet.

It would appear that leaving out an extension in the php.ini, such as PDO, results in the extension becoming disabled.

I would suggest you grab a sample/default php.ini file and add your modifications. Here is a previous SO post about sample php.inis, https://stackoverflow.com/a/9602645/1349295.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top