...

View Full Version : Script doesn't work with Safe Mode



Michiel
10-16-2004, 02:52 PM
Hi,

I've recently finished the first version of my verry own Content Management System. It's build in php and uses object-oriented coding. While testing the script on different servers, I came accros the fact that the script doesn't work when safe mode is turned on.

Contacting the hosting company was useless as they claim they can't turn it of because of security issues.

So now actually my question is whether there exists a workaround for safe mode? And if not, what generally causes the safe mode error, so I can try and rewrite the script, if possible ...


Cheers,

Michiel

raf
10-16-2004, 03:00 PM
I think we need a bit more info.

If safe-mode is enable, then some of the functions wount have effect. So you need to figure out which ones --> usually mentioned on that functions page in the manual

Michiel
10-16-2004, 03:08 PM
Well,

I'm not sure where I can find a list of functions that are disabled, I guess I need some more info on where to find that ... ;)

All I know is that mkdir() doesn't work, and I can imagine that fwrite() won't work either. This is the error message I get:

Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid is 613 is not allowed to access /home/virtual/site72/fst/var/www/html/db owned by uid 48 in /home/virtual/site72/fst/var/www/html/database.class.php on line 156

If you need more info, please let me know ...

Cheers, Michiel

raf
10-16-2004, 06:08 PM
Well,

I'm not sure where I can find a list of functions that are disabled, I guess I need some more info on where to find that ... ;)
You'll need to run through all functionalitys so that each script is executed for all possible situations.

On all pages that you get errormessages returned or see unexpected results, you'll going to need to look up in the manual (www.php.net) why certain functions don't work.


All I know is that mkdir() doesn't work, and I can imagine that fwrite() won't work either. This is the error message I get:

Warning: mkdir(): SAFE MODE Restriction in effect. The script whose uid is 613 is not allowed to access /home/virtual/site72/fst/var/www/html/db owned by uid 48 in /home/virtual/site72/fst/var/www/html/database.class.php on line 156
The errormessage is quite clear. Certainly if you lookup that function in the manual at http://www.php.net/mkdir where you'll get

Note: When safe mode is enabled, PHP checks whether the directory in which you are about to operate has the same UID (owner) as the script that is being executed.

But basically, i woudn't bother with all this. A host that only allows you to run PHP in safe-mode is useless for most serious development.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum