Symptoms
Your server is using the LSAPI handler by either using the LiteSpeed web server, or by using the CloudLinux version with mod_lsapi with Apache.
You have made changes to the php.ini path, or changes to the settings in the php.ini file, but those changes are not reflected when visiting your website, or when checking them via a phpinfo() file as outlined in the following resource:
How to use a PHPInfo file for troubleshooting PHP issues
You may also notice that the problem does not persist if you change the version of PHP for the site, or if you change to a different handler such as suPHP.
This can cause your website to produce errors, or fail to load entirely.
Description
The LSAPI handler makes use of what LiteSpeed refers to as PHP Detached Mode and is described in their documentation here:
LiteSpeed Wiki - Detached PHP Mode
When PHP is run in detached mode, the detached PHP processes must be restarted to see changes to the php.ini path or any changes within the php.ini file.
Resolution
To resolve this issue, you'll need to force the detached php processes to restart. How you do this is different depending on the variant of LSAPI in use.
LiteSpeed Webserver
If you are making use of the LiteSpeed webserver you can restart the detached PHP processes for all users on the server with the following command:
touch /usr/local/lsws/admin/tmp/.lsphp_restart.txt
If you just want to restart the detached PHP processes for a single user you may use the following command, just be sure to update the username as required:
touch /home/CPANELUSERNAME/.lsphp_restart.txt
LiteSpeed specifically actively monitors those file locations for changes to the timestamps, so touching the files is like sending a direct command to LiteSpeed.
CloudLinux mod_lsapi with Apache
If your server is running Apache with mod_lsapi, you may restart detached PHP for a user with the following command, but be sure to update the username as required:
touch /home/CPANELUSERNAME/mod_lsapi_reset_me
Due to the mod_lsapi module, Apache actively monitors those file locations for changes to the timestamps so touching that file is like sending a command directly to Apache to restart the processes.
Universal
Ultimately, as long as the PHP processes are restarted, they will load the new php.ini location and settings. Therefore you could simply kill all of the lsphp processes and LiteSpeed / mod_lsapi will automatically restart them as needed.
IMPORTANT: For most PHP applications it is not detrimental to kill a PHP process before it has finished executing. Although it is possible that killing PHP processes in the following manner could result in corrupted data or other problems. For example, if the PHP process was in the middle of a critical database update, killing processes in this way may cause problems. Use this method at your own risk.
It is possible to kill all LSPHP processes and force them to restart with the following command:
*** SEE ABOVE NOTE BEFORE ISSUING THIS COMMAND ***
killall lsphp