Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Apr 2004
    Location
    Fort Walton Beach, FL
    Posts
    29

    Default Need safe mode On but for only 1 client

    I currently run php safe mode off. I have a client requesting that his account have safe mode turned on.

    I am running CentOS 3.4 and have php 5.04, zend, phpsuexec and more.
    I've tried php_admin_flag safe_mode 1 but no prevail.

    Please advise.

    Thanks,
    David Guerra
    David Guerra of,
    http://VerticalHost.com/

  2. #2
    Member tuxdesk's Avatar
    Join Date
    Oct 2005
    Posts
    86

    Default

    php_admin_flag safe_mode On

    try this in /usr/local/apache/conf/httpd.conf
    Last edited by tuxdesk; 12-24-2005 at 05:26 AM.
    Tux
    Aim : tuxdesk
    Msn : tuxdesk@hotmail.com
    Yahoo: tuxdesk@yahoo.com

    __________________________________________________
    "You don't slow down because you get old; you get old because you slow down."

  3. #3
    __arjun__
    Guest

    Default

    That should be entered your clients virtualhost entry, otherwise the changes would be global.
    Another solution is to use .htaccess file to control this ( But I am not sure whether this works or not. Check it out in any case )

    Code:
    php_flag safe_mode 1
    If this doesn't work, then adding the following lines

    Code:
     php_admin_flag safe_mode on
    in your clients virtualhost entry would be enough.


    BTW, have you confirmed that php safe mode for your client is indeed off?
    Just setup one phpinfo page for your client and check if its indeed off.

  4. #4
    Member
    Join Date
    Feb 2004
    Posts
    469

    Default

    Quote Originally Posted by verticalhost
    I am running CentOS 3.4 and have php 5.04, zend, phpsuexec and more.
    Quote Originally Posted by __arjun__
    ...Another solution is to use .htaccess file to control this ( But I am not sure whether this works or not. Check it out in any case )
    This will not work with apache compiled with phpSuExec. You must use a php.ini file in the users web root or a directory the script is called from.

    Safe mode on or off is not a concern when phpSuexec is used. But if your client wants it turned on then a php.ini file in the web root (public_html) or the directory where a php script is called, with:
    safe_mode = On
    will do the trick.

    When safe mode was turned on it would take a fit if the UID/GID were different to the clients but with phpSuExec this is not a problem as all UID/GIDs belong to the client.

    As David (verticalhost) has phpSuExec installed any reference to a .htaccess file is irrelevant.


    Last edited by Izzee; 12-24-2005 at 03:35 PM. Reason: Added more detailed information

  5. #5
    Member WebScHoLaR's Avatar
    Join Date
    Dec 2005
    Location
    Planet Earth
    Posts
    506

    Default

    Quote Originally Posted by verticalhost
    I currently run php safe mode off. I have a client requesting that his account have safe mode turned on.

    I am running CentOS 3.4 and have php 5.04, zend, phpsuexec and more.
    I've tried php_admin_flag safe_mode 1 but no prevail.

    Please advise.

    Thanks,
    David Guerra

    You can do it for one account by adding the following line in the .htaccess file:

    php_flag safe_mode on

    But make sure that you cannot alter the php.ini settings with .htaccess when running PHP as cgi/phpsuexec.

    Check this link,

    http://webhostingtalk.com/showthread.php?t=421482

    Regards,
    WebScHoLaR

    WebHosting Blog: http://WebScHoLaR.net

  6. #6
    Member
    Join Date
    Apr 2004
    Location
    Fort Walton Beach, FL
    Posts
    29

    Default

    Thanks for the advise. I will try these and let you know which one worked.
    David Guerra of,
    http://VerticalHost.com/

  7. #7
    Member
    Join Date
    Apr 2004
    Location
    Fort Walton Beach, FL
    Posts
    29

    Default

    Just for the usefulness of everyone else.

    If you have php safemode off and phpsuexec enabled, then you can safemode a single user account by adding a file named php.ini in the public_html folder.

    The contents of php.ini should be

    --------cut-----------

    safe_mode = On

    --------cut-----------

    Works like a charm.

    Thanks!
    David Guerra of,
    http://VerticalHost.com/

  8. #8
    Member
    Join Date
    Apr 2004
    Location
    Fort Walton Beach, FL
    Posts
    29

    Default

    Sorry,

    Not everything is a charm yet.

    When adding the php.ini file it only does 1 directory.
    The user is needing all directories to be in safe mode.
    Anymore ideas?
    David Guerra of,
    http://VerticalHost.com/

  9. #9
    Member tuxdesk's Avatar
    Join Date
    Oct 2005
    Posts
    86
    Tux
    Aim : tuxdesk
    Msn : tuxdesk@hotmail.com
    Yahoo: tuxdesk@yahoo.com

    __________________________________________________
    "You don't slow down because you get old; you get old because you slow down."

Similar Threads & Tags
Similar threads

  1. php safe mode
    By thewebhosting in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-19-2009, 01:23 PM
  2. safe mode (on or off )
    By Rashad in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 03-05-2008, 12:30 AM
  3. Safe Mode
    By _sombra_ in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-04-2004, 08:43 PM
  4. Safe Mode - A B.U.G ???
    By donnie in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-11-2003, 11:38 AM
  5. Safe Mode!! Help??!?
    By SimGuy in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 02-04-2003, 07:47 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube