Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •