How to turn off safe mode with htaccess

Discussion in 'Plesk 7.1 Reloaded Troubleshooting and Problems' started by edward, Sep 23, 2004.

  1. edward

    edward Guest

    Hi

    i am very new to the whole php scripting world and am trying to install a gallery on my Web site hosted using Plesk 7 reloaded for unix. I have been told i need an .htaccess file to disable the safe mode for my domain but am unsure what needs to be included in this htaccess file.

    Help please :(
  2. cnelissen

    cnelissen New Member

    Messages:
    11
    I dont have a working .htaccess file for you to use, but this is the directive you need to add to an .htaccess file

    php_value safe_mode "0"
  3. alex042

    alex042 Guest

    This may only work if allow overrides is allowed on the server.
  4. jstuart

    jstuart Guest

    your BEST bet is if you want to do it domain wide is create in /home/http/vhosts/<domain.com>/conf a vhost.conf file which includes the following:

    Code:
    <Directory /home/httpd/vhosts/<domain.com>/httpdocs>
        <IfModule sapi_apache2.c>
            php_admin_flag safe_mode off
        </IfModule>
    </Directory>
    
    and then as root, run the following command:

    Code:
    /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=<domain.com>
    
    and finally restart apache.
  5. jagsinc

    jagsinc Guest

    register_globals with safe_mode in the vhost.conf

    If I wanted to turn php safe mode off and register_globals on for the domain would the vhost.conf look like this?

    <Directory /home/httpd/vhosts/<domain.com>/httpdocs>
    <IfModule sapi_apache2.c>
    php_admin_flag safe_mode off
    php_admin_flag register_globals on
    </IfModule>
    </Directory>

    Thanks
  6. jagsinc

    jagsinc Guest

    that works
  7. irzyxel

    irzyxel New Member

    Messages:
    68
    hmm, whats the trick for subdomains ???

    <Directory /home/httpd/vhosts/domainname.com/subdomains/foo/httpdocs>
    php_admin_flag safe_mode off
    </Directory>

    doesnt work for me, atleast on in the main domains conf dir
    does it need to be in the subdomains/foo/conf/vhost.conf ?
  8. Whistler

    Whistler New Member

    Messages:
    478
    Yes :)
  9. arvin

    arvin New Member

    Messages:
    48
    YES! It's worked!

    Thanks!

    but I do a test before and after do change with a PHPinfo() function:

    <?php
    phpinfo();
    ?>

    and save on my httpdocs and browse it before and after do the changes I nedd for certain site.

    thnaks again.

Share This Page