简体   繁体   中英

php-fpm wont load php.ini settings

I'm using nginx and php-fpm.

My phpinfo page says php is loading the php.ini file from /etc/php5/fpm/php.ini, I tried updating that file then running

sudo service php-fpm reload

But php still uses old settings, phpinfo shows old values as if I didn't modify anything.

I tried restarting php-fpm and even restarting my computer but it still doesn't work, it just wont load the new php.ini values...

You may want to check your FPM Pool Configuration. You can also set php.ini settings there which in my opinion is a better place when using FPM.

You'll find something like this at the end of your FPM Pool Configuration:

; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
;   php_value/php_flag             - you can set classic ini defines which can
;                                    be overwritten from PHP call 'ini_set'.
;   php_admin_value/php_admin_flag - these directives won't be overwritten by
;                                     PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.

; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.

; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr/local)

; Default Value: nothing is defined by default except the values in php.ini and
;                specified at startup with the -d argument

Now you can add random configuration changes such as:

php_flag[display_errors] = on

php_admin_flag[log_errors] = on

php_admin_value[memory_limit] = 128M
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i

Of course, be certain that you restart FPM after you change the configuration so that it takes effect.

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