Question

How to Refresh PHP Server

Hello,

How do I refresh my server? I updated our php.ini file for PHP version 8.0 but the changes don’t seem to be showing properly. What do I need to do to get the changes to show up?

Any help would be greatly appreciated!


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @d8ce18629910-41ba-a430-d7058a,

You need to restart your Apache or Nginx server for the changes to take effect. That is related to updating any PHP server-wide settings. If you however updated a php.ini for a separate website/app that everything should load with any need of a reload/restart.

Additionally, if you have php-fpm, you might need to restart that as well!

Here is what I use with debian server, apache, and fpm php:

# Restart all fpm php and reload apache:
#*******
{
FileList=$(/bin/ls -1 /etc/php/*/*/php.ini)
for FILE in `echo "$FileList"`;
do

if echo "$FILE" | grep --quiet "fpm"; then
echo "$FILE"
phpversion=$(echo "$FILE" | awk -F/ '{print $4;}' )
phpreload=$(echo "php""$phpversion""-fpm")
echo "systemctl restart $phpreload"
echo
systemctl restart "$phpreload"
fi

done
systemctl reload apache2
}

What setup do you have?

This comment has been deleted