Output of phpinfo() and php -i command totally different

January 19, 2015 3k views

I have wordpress running on LEMP stack. I had recently installed memcached module for handling sessions, but it threw some errors: in PhpMyAdmin and Wordpress Social Login - both used session_start which got disabled. I debugged this for several hours but no luck, so I decided to go back to disk based sessions (files) on our live site and continue with the debug on a development server.

I have uninstalled memcached from both PECL and DPKG. I updated php.ini settings accordingly and restarted php5-fpm and nginx services, but the errors did not go away.

According the nginx log "PHP cannot find save handler: memcached"

phpinfo() in the front end tells me that

a) memcache.ini additional file is being loaded from /etc/php5/fpm/conf.d/
b) memcache support is enabled
c) session save_handler is memcached

The ini file does not exist. The memcache and memcached packages have been removed and the session savehandler is set to files along with a savepath. The output of php5-fpm -i confirms all this.

What is happening? I suspect PHP5-FPM pool configurations or something..

1 comment
  • Off the top of my head, doesn't php -i command read values from /etc/php5/cli/php.ini, whereas the output of the phpinfo() function in a file reads the actual php.ini used by your web server (usually /etc/php5/cli/php.ini)?

1 Answer

This question was answered by @tomak:

Off the top of my head, doesn't php -i command read values from /etc/php5/cli/php.ini, whereas the output of the phpinfo() function in a file reads the actual php.ini used by your web server (usually /etc/php5/cli/php.ini)?

View the original comment

Have another answer? Share your knowledge.