简体   繁体   中英

webserver: php.ini changes not taking effect

According to phpinfo() the following php.ini files are loaded:

Configuration File (php.ini) Path   /etc/php5/cgi
Loaded Configuration File   /var/www/vhosts/mywebsite.com/etc/php.ini
Scan this dir for additional .ini files     /etc/php5/cgi/conf.d 

I've made changes to php.ini found in /etc/php5/cgi - restarted server - NO Effect.

This file: /var/www/vhosts/mywebsite.com/etc/php.ini has the note:

DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

The server has these php.ini files

/etc/php5/cli/php.ini /etc/php5/cgi/php.ini /etc/php5/apache2/php.ini /opt/psa/admin/conf/php.ini /var/www/vhosts/mywebsite.com/etc/php.ini

Could you please tell me which php.ini file should I look for?

If you want to add something to php.ini (as xdebug properties, for example), then you should use /etc/php5/cgi/conf.d folder (create or edit one of that files).

As for php.ini located in cgi - seems right that you've done. However, there still exists a possibility, that you can edit these files, but they are overwritten by general configuration by your provider. I would advice to check it locally, if the same configuration would work. EDIT: /opt/psa/admin/conf/php.ini looks like a possibility of this variant.

Also I would advice to edit apache's php.ini, but it looks more like a magic path.

I had a syntax error at 1. line!

It was :[php] instead of [php]. PHP ignored my config file because it couldn't see a php section

For me that fixed everything; Run php -c 'path-to-php.ini' . It will show you more information.

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