Re-reading .ini files in a limited environment

How do I force the system to re-read an ini to apply the change?

My site is remotely hosted through cPanel. It is a shared resources configuration and I don’t have root privilege. I do have considerable rights but not all the way down to the level of Apache administration (for instance.)

In this shared hosting environment the subscribers don’t have access to su, sudo, service, apache2, apache2ctl

These PHP family tools/commands are available with at least --x–x–x privilege:
lsphp, lsphp.cagefs, pear, peardev, pecl, phar.phar, php, php-cgi, php-cgi.cagefs, php-config, php.cagefs, phpize

cPanel provides these gui tools (forgive any overlap with above)
(I understand they don’t necessarily apply to PHP administration)
PHP Pear Packages
MultiPHP INI Editor

terminal (RHE BASH)
a GUI file manager with an editor

Background and impetus:
I’m testing a music hosting package, but for the context of this question I want to remain more general. The name is below.

I’m new at PHP but I have a few years experience as a sysadmin for other systems. That said the PHP ini files used in the music system appear to be rather straightforward and well commented.

I’d like to un-comment a line to see the affect. (no problem, I’ve got the rights and understand the responsibility)

Server Details:
The music server is named “Ampache” - with an “m”

Nobody has answered your question because there is no question really in the post.

Let’s see… You have a server with limited access. All good. You have PHP files and some sort of INI file you want to read. All good. You can edit the INI file. All good. No problem stated so far. But, I will guess at what you are really asking…

You want to alter an INI file and then have the music server system access it. But, you talk about he PHP.ini file. This is NOT a configuration file. It is a server ini file for controlling PHP. If you ever change the PHP.ini file, you must reboot your server for it to take effect. If that is what you are asking, then, make a change reboot the server and see if it works. Normally, you do not do this.

Instead, you can use PHP itself to make changes to the PHP.INI file on the fly. This is done by most sites as needed. This way, no need to reboot. Also, every page can alter the INI as needed. For example PHP times out after a set time-limit. If a page takes too long, PHP will stop it from processing and throw out a log record of the error. You can extend how long it allows using simple PHP ini commands that can extend the time-out number. In that way, pages that use a lot of processing time can still run. Not sure if that is a good explanation or not, but, hope it helps.

If you tell us which PHP.INI lines you are thinking of changing, we can help you get it working without rebooting the server every time.

Sponsor our Newsletter | Privacy Policy | Terms of Service