Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    111

    php safe mode and running php scripts from root ssh

    I have enabled php safe mode on my server.

    Fortunetly I can specify in httpd.conf user that can run without those restriction by placing
    php_admin_flag safe_mode Off

    However I especialy need to disable those restrictions on php scripts running from root shell or any user shell by /usr/bin/php ...


    I cant specify that in httpd.conf do I? Is there any way? I really need it, because scripts that run under root shell have also root file permissions and that means that script can acces and modify all files anywhere...

  2. #2
    Why is root running PHP scripts to begin with? Why can't you run those in userland?

  3. #3
    Join Date
    Apr 2004
    Posts
    111

    Re: php safe mode and running php scripts from root ssh

    Originally posted by nand
    I really need it, because scripts that run under root shell have also root file permissions and that means that script can acces and modify all files anywhere...
    also that way scripts will be able to kill, start, sudo start, ulimit programs for any user

  4. #4
    Use another one php.ini with turned of safe_mode
    You should run your scripts such as
    /usr/bin/php -c /path/to/your/safe_mode_off_php.ini /path/to/your/script.php

  5. #5
    Join Date
    Apr 2004
    Posts
    111
    THANKS! thats exacly what I've been searching for. Thank you.

Posting Permissions

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