gsus

Registered
Jun 13, 2007
2
0
51
Hi cPanellllllers,

i'm currently having a bit of grief trying to figure out what to do with custom php.ini files with suphp.

As you know already php.ini files don't stack, so if you use a custom php.ini file with only a few settings in it (eg memory_limit, register_globals) it will set these, but every non specified setting results back to defaults rather then what your global php.ini says they should be.

My questions are:
  • What do you guys/gals do to sort this out? do you put full copies of your php.ini in public_html directories and scramble to update them all every time you need to make a change, or do you do opt to use something other then suphp because of this problem?
  • How do you enforce suhosin limits if the global php.ini file does not get read whenever a custom one is used? eg how do I put a celing on memory_limit if the global php.ini isnt being read?
 

MattCurry

Well-Known Member
Aug 18, 2009
275
0
66
Houston, Tx
php.ini

Hello,

I do see what you are trying to accomplish with your question. However there is only two basic ways to setup the php.ini that cpanel uses. One, you could use the global php.ini as you asked, or put a php.ini in the users public_html directory.
As far as the memory question goes you can set a memory limit per script in the php.ini using 'memory_limit=128m', and I put 128m in there but you can put whatever you like within reason.

I hope this gets your question answered.

Thank you,
Matthew Curry
 

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
7
68
PK
cPanel Access Level
DataCenter Provider
Hi cPanellllllers,

i'm currently having a bit of grief trying to figure out what to do with custom php.ini files with suphp.

As you know already php.ini files don't stack, so if you use a custom php.ini file with only a few settings in it (eg memory_limit, register_globals) it will set these, but every non specified setting results back to defaults rather then what your global php.ini says they should be.

My questions are:
  • What do you guys/gals do to sort this out? do you put full copies of your php.ini in public_html directories and scramble to update them all every time you need to make a change, or do you do opt to use something other then suphp because of this problem?
  • How do you enforce suhosin limits if the global php.ini file does not get read whenever a custom one is used? eg how do I put a celing on memory_limit if the global php.ini isnt being read?
You may copy the entire server level php.ini file in the client's public_html folder or specify the path of the php.ini file that is used for that particular client. You can place php.ini anywhere and have this directive in public_html/.htaccess

suPHP_ConfigPath /home/username/php5-config

As you say, any undefined variable is set to default rather than what global php.ini specifies, so logical choice would be to copy the entire php.ini file at a specific path under root ownership and define the path of the php.ini file in .htaccess.
 

gsus

Registered
Jun 13, 2007
2
0
51
the 2 problems copying the global php.ini to the users directories and editing it are extension path changes in future upgrades will mean I have to search out and edit every custom php.ini, and not being able to put an upper limit on things like memory_limit - with suhosin + php cgi you could specify suhosin.memory_limit as an upper value, set your default memory_limit and that way if customers wanted more then the default they could set something reasonable and if they set anything higher then the suhosin.memory_limit either via the script itself or .htaccess php_value's it would only reach the suhosin.memory_limit.

surely there has to be a better way? id switch back to non suphp methods if they didn't break whilst using mod_userdir...