简体   繁体   中英

php.ini not reflecting changes ever after server restart

I needed to change few values in php.ini file and after running phpinfo() within my application, found my php.ini file in below location

Configuration File (php.ini) Path /opt/php-5.6.30/lib

Loaded Configuration File /opt/php-5.6.30/lib/php.ini

Changed the values in above php.ini file followed by apache2 restart but they didn't reflect.

I ran php --ini command to see any other php.ini files and got following folders:

/etc/php/7.0/cli

/etc/php/7.0/apache2

/etc/php/7/0/fpm

so changed values in all of those php.ini files followed by apache2 and php7.0-fpm restart but to no effect.

I'm puzzled as my application's "loaded configuration file" is using php 5.6.30 which is in /opt/php-5.6.30 folder without any apache2 folder within and php-fpm points at /etc/php/7.0 folder.

None of those ini files followed by apache & php-fpm service restarts is actually reflecting my changes.

Any suggestions/pointers would be much appreciated.

I think the problem is that you are using different php versions for php-fpm (web), and cli. You should create test.php file, and run there phpinfo(). And check where loaded php.ini of web version is located. You should access test.php from web, like https://example.com/test.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM