1
votes

I have a lot of differences between what is shown on console via php -i, and what is shown by apache via phpinfo().

For instance:

  • pdo_mysql exists for the first case, not for the second one.
  • include directive works only for the first case.

PHP.INI file is the same:

Console php -i:

Configuration File (php.ini) Path => /usr/local/etc/php/7.1

Loaded Configuration File => /usr/local/etc/php/7.1/php.ini

Scan this dir for additional .ini files => /usr/local/etc/php/7.1/conf.d

Additional .ini files parsed => /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini

PDO drivers => mysql, odbc, sqlite

VS Web phpinfo():

Configuration File (php.ini) Path /usr/local/lib

Loaded Configuration File /usr/local/etc/php/7.1/php.ini

Scan this dir for additional .ini files (none)

Additional .ini files parsed (none)

PDO drivers sqlite


For additional info, here is my apache configuration:

LoadModule php7_module /usr/libexec/apache2/libphp7.so

PHPINIDir /usr/local/etc/php/7.1/

AddHandler application/x-httpd-php .php

And include directive in /usr/local/etc/php/7.1/php.ini

include=/usr/local/etc/php/7.1/conf.d/*.ini

I restarted apache after every php.ini modification.


Any idea, any clue?

1
because some servers use a cli-php.ini file for command line. In other words you may have separate config files one for Apache one for the Command line.ArtisticPhoenix
@ArtisticPhoenix as you can see in the data given, it doesn't seem so. Loaded php.ini is the same.theredled
But in the second your missing this additional one, ext-xdebug.iniArtisticPhoenix
@ArtisticPhoenix you're right, that's one of the reasons why I created this thread...theredled

1 Answers

1
votes

Solved, whereas php.ini was the same, there were 2 different PHP7 builds running on CLI and Apache. Tricky but solved!