Problem starting php

Strator

Verified User
Joined
Jan 19, 2011
Messages
274
This question may seem ridiculous, but how do I restart php? After changing php.ini, which resides in /usr/local/php80/lib, I've tried the usual suspects:

systemctl restart httpd.service

systemctl stop httpd.service
systemctl start httpd.service

systemctl restart nginix.service (nginx is running as reverse proxy)

But the changes don't take effect.

apachectl configtest has no errors.

Rebooting does the trick, but obviously, I don't want to reboot the entire server every time I alter php.ini. (This is an Almalinux 9 server in case this makes any difference.) Any ideas very welcome!
 
With those commands, you're restarting your webservice. If you have PHP compiled-in (i.e. mod_php), this should work. Since it doesn't, I'm going to assume you are using PHP-FPM, which means PHP will be its own service. Doing systemctl restart php-fpm<tab> should show you a service for each version of PHP you have installed.
 
Thanks, that got me on the right track.

systemctl list-unit-files | grep enabled

...lists all services by name. So in the end, this worked for me:

service php-fpm80 restart
 
Back
Top