Fcgi and reloading php.ini

software development

#1

I am running php with fcgi and a custom php.ini. When I edit php.ini, it seems that fcgi takes its time getting around to reloading the config. Is there a graceful and safe way to kill and restart my php5.cgi processes?


The subtle source is clear and bright
The tributary streams flow through the darkness

http://davidmintz.org/


#2

touch your custom php5.cgi so the server thinks it’s new :wink:

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

Ah, the old magic touch! Thanks very much.


The subtle source is clear and bright
The tributary streams flow through the darkness

http://davidmintz.org/


#4

I don’t know the magic touch! Someone care to share how to do this on the command line?


#5

‘touch’ is a *nix command to update the last access and last modification timestamps of a file. If the file does not exist it will also be created as a zero-byte empty file if touch is invoked without arguments. There several command line arguments to modify the behavior of touch, see ‘man touch’.

From the command prompt
$ touch filename


#6

Actually, that part is familiar to me. What I was wondering is which file do I need to touch to get fcgi to reload my php.ini again?


#7

The advice in this thread is out of date. At this point, the easiest and most reliable way to reload php.ini (whether you’re using a custom PHP 5.2 setup or the standard PHP 5.3 / phprc method) is to simply killall running PHP processes:

killall php5.cgi (for PHP 5.2) killall php53.cgi (for PHP 5.3)