Results 1 to 11 of 11
  1. #1

    How to turn PHP safe mode off?

    I am trying to use the backquotes to execute a system command, but it says the following message:
    Warning: Cannot execute using backquotes in safe mode in /home/virtual/site1/fst/var/www/html/test.php on line 9
    So.. I guess I need to turn off safe mode. I have no idea how to do this.

    Can anyone walk me through? phpinfo() says that my "safe_mode" directive is off for Master Value, but is on for Local Value.

    I guess there's a switch somewhere I need to set?

    Thanks!

  2. #2
    Join Date
    Sep 2002
    Posts
    77
    http://www.php.net/manual/en/features.safe-mode.php

    In php.ini set safe mode to off I believe.
    Fuel Guru
    High Octane Web Hosting!
    http://www.fuelhosting.com

  3. #3
    My php.ini already is telling me that safe_mode is off.

    This is from my php.ini file:

    ;
    ; Safe Mode
    ;
    safe_mode = Off


    Does anyone know why the Master Value says off, but the Local Value says it is on?

    What does local value mean? How can I set this off?

    Thanks!

  4. #4
    Join Date
    Sep 2002
    Posts
    77
    did you restart?
    Fuel Guru
    High Octane Web Hosting!
    http://www.fuelhosting.com

  5. #5
    Join Date
    Sep 2002
    Posts
    77
    Apache --- Sorry do not restart the server just restart Apache the service.
    Fuel Guru
    High Octane Web Hosting!
    http://www.fuelhosting.com

  6. #6
    Join Date
    Mar 2001
    Location
    Ireland
    Posts
    1,354
    The 'master' value is your php.ini , while the 'local' one refers to the directory you are looking at.

    Basically you can override/change the local value using a .htaccess

    I'd advise you to poke around on the PHP site.
    Blacknight
    ICANN accredited domain registrar

  7. #7
    Originally posted by blacknight
    The 'master' value is your php.ini , while the 'local' one refers to the directory you are looking at.

    Basically you can override/change the local value using a .htaccess

    I'd advise you to poke around on the PHP site.
    I have confirmed that the php.ini file has safe_mode set to off, and have restarted apache to make sure.

    So now I need to find out why the Local Value is set to on..

    Is there a way to search all files within a group of directories for the words "safe_mode"? I looked at the .htaccess file for the directory, but couldn't find anything to do with php. I figure maybe I can search for this text and then simply look inside each resulting file to see if it is being set there.

    Thanks.

  8. #8
    Look at the link fuelguru posted above, read the whole page. That's the answer you need.
    YourCheapHost.com - Low cost multi domain hosting solutions. [Legal adult content friendly]
    Reliable web site hosting is our motto. We have Alertra stats to back that up.
    Proven provider of high quality shared and reseller accounts since 2002.

  9. #9
    Originally posted by net-trend
    Look at the link fuelguru posted above, read the whole page. That's the answer you need.
    I must be stupid, then.

    After reading that whole page three times I still can't figure out how to set the Local Value of safe_mode to off. I've looked in php.ini, httpd.conf, .htaccess files and a few other places, but can't find anywhere that has safe_mode set to on.

    Can anyone help?

  10. #10
    Join Date
    Nov 2001
    Posts
    852
    Are you using any sort of hosting control panel?

  11. #11
    Join Date
    Aug 2002
    Location
    Toronto, Canada
    Posts
    286
    just add this to the end of the httpd.conf file and restart apache.

    <Directory /var/www/html>
    php_admin_flag safe_mode off
    </Directory>
    www.prolinker.com - free automatic linking to your website

Related Posts from theWHIR.com

Posting Permissions

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