Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php-fpm wont load php.ini settings

Tags:

php

nginx

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...

like image 905
gosukiwi Avatar asked Jun 03 '26 14:06

gosukiwi


1 Answers

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.

like image 131
Diemuzi Avatar answered Jun 06 '26 03:06

Diemuzi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!