Config of php parameters in php.ini (difference between default and admin)

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Config of php parameters in php.ini (difference between default and admin)

Post by spcherub »

My host allows me to configure the values for php parameters in a local php.ini file.

Initially when I tried to create a php.ini file in the CMSMS root folder, the Site Admin->System Information page did not seem to reflect the settings in this ini file. For instance I set "output_buffering = 1", but the System Information page still reported "output_buffering = 0".

When I created my own test script in the root directory with a call to the phpinfo() function, the settings in the php.ini seem to be reflected there, so I was not sure what was going on with the System Information page.

I then copied the php.ini file into the admin folder - at that point the System Information page updated with the modified parameter values as per the php.ini file.

So it looks like (at least in my installation), I need to have a copy of the php.ini in both folders (I assumed that the scripts in /admin will inherit from the php.ini values in the root folder).

Question is - which php.ini is being processed for the front-end of the site? I'm assuming it is the one in the root folder. So even while the System Information page was not showing the right values, the site may have been running with the right values (in the case where I had the php.ini file in the root but not in /admin).

Can the CMCMS experts validate my assumption?

TIA
User avatar
Gregor
Power Poster
Power Poster
Posts: 1874
Joined: Thu Mar 23, 2006 9:25 am

Re: Config of php parameters in php.ini (difference between default and admin)

Post by Gregor »

Maybe a little late, however I think you find your answer here:
http://forum.cmsmadesimple.org/index.php/topic,30322.0.html

phpinfo() tells you wich php.ini is loaded from what directory.

Gregor
Redmare
New Member
New Member
Posts: 2
Joined: Thu Jan 28, 2010 12:40 pm

Re: Config of php parameters in php.ini (difference between default and admin)

Post by Redmare »

I know this is an old post but I'm having the same problem as the OP. I've searched in the forums and the documentation, but I haven't found an answer yet.

I changed the default setting "max_execution_time = 30" to "max_execution_time = 60" in my php.ini file, but I only see the changes when I make the call to the phpinfo() function. The installation wizard still gives me the warning about a setting which I've already changed. Clicking on "Display PHP Information" at the installation screen still gives me "max_execution_time = 30", while calling phpinfo() gives me the updated setting (max_execution_time = 60).

Copying the php.ini file to the admin folder did not work for me either. How come CMSMS isn't reading the updated php.ini data? phpinfo() says that it's loading php.ini at the root folder. That's the one I changed, but CMSMS is not recognizing it.
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: Config of php parameters in php.ini (difference between default and admin)

Post by spcherub »

I am the OP - the way I "fixed" the problem was to copy the the modified php.ini into both the root and /admin folders. When the default (public facing) pages run they read from the php.ini in the root (of CMSMS) folder. When the admin backend pages run the read the settings from the /admin folder. As long as you keep these versions in sync you should be fine.

Another thing you should check is whether or not your hosting provider allows the use of custom settings via php.ini - based on your comments below it sounds like they may, but you may want to check their FAQ anyway.
Redmare
New Member
New Member
Posts: 2
Joined: Thu Jan 28, 2010 12:40 pm

Re: Config of php parameters in php.ini (difference between default and admin)

Post by Redmare »

spcherub wrote: I am the OP - the way I "fixed" the problem was to copy the the modified php.ini into both the root and /admin folders. When the default (public facing) pages run they read from the php.ini in the root (of CMSMS) folder. When the admin backend pages run the read the settings from the /admin folder. As long as you keep these versions in sync you should be fine.

Another thing you should check is whether or not your hosting provider allows the use of custom settings via php.ini - based on your comments below it sounds like they may, but you may want to check their FAQ anyway.
I tried copying the php.ini in the root to the admin folder, but I was still getting the warning message saying the "max_execution_time" was '30' instead of '60' even though phpinfo() reports back that it was '60'. I'm not sure if this has something to do with my hosting server. I'm using a server that's running PHP from CGI, not Apache. I even tried setting the php values in .htaccess with these instructions:

Code: Select all

<IfModule mod_php5.c>
# mod_suPHP is active - php.ini overrides must be within these tags or in your local php.ini
# To set a recursive php.ini, add the following line to the top of this file:
# SuPHP_ConfigPath /home/yourusername/foldercontainingphp.ini
</IfModule>
I'm not too technical when it comes to server-related problems, if in fact that is the problem. Any suggestions?
Locked

Return to “[locked] Installation, Setup and Upgrade”