Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-16-2004, 01:52 PM   PM User | #1
Michiel
Regular Coder

 
Join Date: Jul 2002
Location: The Netherlands
Posts: 252
Thanks: 0
Thanked 0 Times in 0 Posts
Michiel is an unknown quantity at this point
Script doesn't work with Safe Mode

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
Michiel is offline   Reply With Quote
Old 10-16-2004, 02:00 PM   PM User | #2
raf
Master Coder


 
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
raf will become famous soon enoughraf will become famous soon enough
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
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html
raf is offline   Reply With Quote
Old 10-16-2004, 02:08 PM   PM User | #3
Michiel
Regular Coder

 
Join Date: Jul 2002
Location: The Netherlands
Posts: 252
Thanks: 0
Thanked 0 Times in 0 Posts
Michiel is an unknown quantity at this point
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
Michiel is offline   Reply With Quote
Old 10-16-2004, 05:08 PM   PM User | #4
raf
Master Coder


 
Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
raf will become famous soon enoughraf will become famous soon enough
Quote:
Originally Posted by Michiel
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.
Quote:
Originally Posted by Michiel
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
Quote:
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.
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html
raf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:40 AM.


Advertisement
Log in to turn off these ads.