1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Can't disable PHP safe_mode

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by GuillaumeH, Apr 15, 2010.

  1. GuillaumeH

    GuillaumeH Basic Pleskian

    20
    90%
    Joined:
    Mar 24, 2010
    Messages:
    40
    Likes Received:
    0
    Hi,


    I want to disable for a website the PHP safe_mode. I edit the domain, desactivate the SAFE_MODE option. But it change nothing.

    in "/var/www/vhosts/<domain>.com/conf/httpd.include" the value "php_admin_flag safe_mode on " stay.

    It seems that Plesk can't modify "/var/www/vhosts/<domain>.com/conf/httpd.include"
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    Try to do it with

     
  3. GuillaumeH

    GuillaumeH Basic Pleskian

    20
    90%
    Joined:
    Mar 24, 2010
    Messages:
    40
    Likes Received:
    0
    Result of the command : SUCCESS: Update of domain '<domain>.com' complete.


    But /var/www/vhosts/<domain>.com/conf/httpd.include is still not modified and SAFE_MODE is still active :(
     
    Last edited: Apr 15, 2010
  4. GuillaumeH

    GuillaumeH Basic Pleskian

    20
    90%
    Joined:
    Mar 24, 2010
    Messages:
    40
    Likes Received:
    0
    . Several scripts for the website need this SAFE MODE desactivate, and I can't change this parameter.

    However it works at the creation of a domain. But not editing an existing domain...
     
  5. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    I can't reproduce it on my test environment:

    Maybe there is something wrong with permissions for config file?
     
  6. GuillaumeH

    GuillaumeH Basic Pleskian

    20
    90%
    Joined:
    Mar 24, 2010
    Messages:
    40
    Likes Received:
    0
    httpd.include as the following right in octal: 0644 root root
     
  7. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    Yes, it is correct permissions. But I can't reproduce it on different servers. Therefore I can suggest you contact support team for checking this problem directly on your server.
     
  8. GuillaumeH

    GuillaumeH Basic Pleskian

    20
    90%
    Joined:
    Mar 24, 2010
    Messages:
    40
    Likes Received:
    0
    I've found a sort of solution

    - I desactivate the domain, so plesk delete /var/www/vhosts/mydomain.com/conf/httpd.include
    - I reactivate the domain, with the safe mode disabled


    Now the httpd.include is recreate with the good parameters.
     
  9. Matthew James

    Matthew James Basic Pleskian

    21
    73%
    Joined:
    Dec 7, 2009
    Messages:
    71
    Likes Received:
    1
    This appears to be a greater issue in 9.5...

    [root@aries ~]# grep -i safe_mode /var/www/vhosts/**********.co.uk/conf/httpd.include
    [root@aries ~]# /usr/local/psa/bin/domain --update **********.co.uk -php_safe_mode false
    SUCCESS: Update of domain '**********.co.uk' complete.
    [root@aries ~]# grep -i safe_mode /var/www/vhosts/**********.co.uk/conf/httpd.include
    [root@aries ~]# /usr/local/psa/bin/domain --update **********.co.uk -php_safe_mode true
    SUCCESS: Update of domain '**********.co.uk' complete.
    [root@aries ~]# grep -i safe_mode /var/www/vhosts/**********.co.uk/conf/httpd.include

    Putting safe_mode off flag in vhost.conf also doesn't work.

    How are we supposed to disable safe mode?
     
  10. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    All works fine for me on 9.5.1:

     
  11. FranzS

    FranzS Guest

    0
     
    nearly the same problem
    if i do a phpinfo() then it shows safe_mode=on
    but in the httpd_include safe_mode param =off

    how do i disable safe mode?
     
  12. Alex James

    Alex James Guest

    0
     
    Same problem is on two of our servers too. One is Plesk 9.5.1 and other is Plesk 8.6.

    /usr/local/psa/bin/domain --update domain.com -php_safe_mode false , is working fine. But the phpinfo page is still showing safe_mode as On.
     
  13. Tobias S

    Tobias S Guest

    0
     
    same problem

    i have the same problem - the safe-mode checkbox is ignored and creating a vhost.conf, websrvmng -a -v
    and restarting apache doesnt work as well.

    Seems that this is a bug and not a user specific problem.

    Igor: When will be a bugfix available to make this fancy checkbox work?
     
  14. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    # cat /usr/local/psa/version
    9.5.2 CentOS 5 95100504.12

    Before unchecking "PHP 'safe_mode' on"

    # grep -i safe_mode /var/www/vhosts/dmin.com/conf/httpd.include
    php_admin_flag safe_mode on
    php_admin_flag safe_mode on
    php_admin_flag safe_mode on
    php_admin_flag safe_mode on

    After unchecking "PHP 'safe_mode' on"

    # grep -i safe_mode /var/www/vhosts/dmin.com/conf/httpd.include
    php_admin_flag safe_mode off
    php_admin_flag safe_mode off
    php_admin_flag safe_mode off
    php_admin_flag safe_mode off

    After enabling "PHP 'safe_mode' on" I see:

    # grep -i safe_mode /var/www/vhosts/dmin.com/conf/httpd.include
    php_admin_flag safe_mode on
    php_admin_flag safe_mode on
    php_admin_flag safe_mode on
    php_admin_flag safe_mode on

    So, I can't reproduce it. As you can see all works fine.
     
  15. Tobias S

    Tobias S Guest

    0
     
    Hi igor,

    i am using debian lenny and in my case it does'nt work.

    i used a clean, updated debian installation and a clean Plesk 9.5.2 installation with only two test domains. The problem appears on both domains.

    Have you tried to change php processing to mod_php and then changing back to fastcgi?

    Tobi
     
  16. Tobias S

    Tobias S Guest

    0
     
    Hi Igor,

    i have tested the issue again on a clean debian 5.0 server with a clean Plesk 9.5.2 installation.

    when using mod_php the checkbox for safe_mode works fine, if is use fastcgi the checkbox has no effect.

    It makes no difference if is create the user with safe mode on or of, it is alway on.

    As we can see in this thread, i'm not the only only one who has reportet this issue, so please do some testing with debian lenny and 9.5.2.

    Tobi
     
  17. Tobias S

    Tobias S Guest

    0
     
    Hi Igor,

    i have done some testing:

    Clean Debian Lenny with Plesk 9.5.2 - safe_mode checkbox works fine for mod_php but has no effect in combination with fastcgi. It makes also noch difference if i create the domain with safe_mode on or off, or change it later. When using fastcgi safe_mode is alway on.

    Same problem with debian Lenny and 9.5.1.

    I'm sure this is a bug and should be solved immediately!

    Tobi
     
  18. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    I have submitted corresponding request to developers. I will update thread with results when I receive it.

    Tobias S, could you please let me know - is it x32 or x64 Debian in your tests?
     
    Last edited: Jul 28, 2010
  19. Tobias S

    Tobias S Guest

    0
     
    Ist 64 bit debian
     
  20. jas8522

    jas8522 Basic Pleskian

    24
    23%
    Joined:
    Feb 3, 2005
    Messages:
    80
    Likes Received:
    0
    Location:
    Halifax, Nova Scotia Canada
    The ability to disable safe_mode when running PHP via FastCGI has been there since FastCGI was added as an option. It's because the apache directives for any PHP controls are never seen by the PHP process running through FastCGI - they simply have no effect. Similarly, any apache directives provided through .htaccess (on a per-domain basis) are ignored by PHP running as FastCGI.

    The correct way to fix this is to have Plesk automatically create a custom php.ini and update the http.includes file for each domain to use this custom php.ini file.

    The manual way to do this is described here:

    http://forum.parallels.com/showthread.php?t=92562

    The workaround is to simply turn safe_mode off in your /etc/php.ini

    When running PHP via mod_apache, the safe_mode setting in Plesk will still work as expected, but anyone running PHP as FastCGI will instantly get safe_mode disabled.

    Hope this helps.

    Jordan
     
Loading...