Web Hosting Talk







View Full Version : php security question


trusty
12-05-2002, 06:50 PM
Hello,

Is there a way to disable custom php.ini files. So the users won't be able to set their own php.ini and overwrite the main php.ini config file ?

I installed php as cgi script with phpsuexec and I set up the php.ini file in /usr/local/lib/php.ini
I disabled the feature display_errors as it might reveal some information.

But any user can set its own php.ini file in his web root directory and totaly overwrite the main php.ini file.
So it makes no reason to set the main php.ini file as it can be overwritten by a local php.ini file.

One of things that came to my mind is I can set a php.ini file in users doc root directory and change their permission to non readable by anyone, then the php.ini is being read from the correct place.

but I don't think that this is a right solution . There must be some thing more elegant. I failed to find any information about this on google.

Any help will be highly appritiated.
And sorry for not using spellchecker :)

DigiCrime
12-05-2002, 07:07 PM
always thought you can set the ownership of a file to something other then the person who owns it to keep it from being changed but i dont know if thats true or not

trusty
12-06-2002, 08:39 AM
I said that I created php.ini in user dir chowned it to root and chmod it to non readable .
The question is : Is this is the only solution to disable from virtual users to create their own php.ini files ?