Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    4

    Default Global safe_mode ON, want Local safe_mode OFF

    Hello,
    I have searched over google that it is possible for me to have safe_mode OFF locally, while having it turned ON globally.
    It is done by adding a line to the VirtualHost tag of the domain in httpd.conf:
    Code:
    php_admin_flag safe_mode Off
    However, in cPanel 11, the system changed and I am quite confused now. I am not sure where to add the line as the new httpd.conf warn me not to edit the file directly.

    Would anybody show me the direction on editing the VirtualHost tag?

    Thank you!!

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by hoball View Post
    Hello,
    I have searched over google that it is possible for me to have safe_mode OFF locally, while having it turned ON globally.
    It is done by adding a line to the VirtualHost tag of the domain in httpd.conf:
    Code:
    php_admin_flag safe_mode Off
    However, in cPanel 11, the system changed and I am quite confused now. I am not sure where to add the line as the new httpd.conf warn me not to edit the file directly.

    Would anybody show me the direction on editing the VirtualHost tag?

    Thank you!!
    As httpd.conf says, use the include files. Here's information on using includes:

    http://www.cpanel.net/documentation/...irectives.html

    Scroll to the section: httpd.conf changes contained in a <VirtualHost>

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jul 2005
    Location
    New Jersey, USA
    Posts
    397

    Default

    You may want to consider using suphp for extra security, and then toggling the options in a local php.ini file in the public_html.

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    4

    Default

    Quote Originally Posted by cPanelDavidG View Post
    As httpd.conf says, use the include files. Here's information on using includes:

    http://www.cpanel.net/documentation/...irectives.html

    Scroll to the section: httpd.conf changes contained in a <VirtualHost>
    Hello,
    Thanks for your reply. I would like to post a follow up question:
    For example, I am editing the domain xxx.com for Local Safe_mode OFF
    in the httpd.conf, there is a section for xxx.com
    Code:
    <VirtualHost 1.2.3.4:80>
        ServerName xxx.com
        ServerAlias www.xxx.com
        DocumentRoot /home/xxx/public_html
        [blah..blah..blah..]
    </VirtualHost>
    What should I add in the include file??
    should I create a full <VirtualHost> tag in Post_VirtualHost_Include, with
    "php_admin_flag safe_mode Off" ?

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by hoball View Post
    Hello,
    Thanks for your reply. I would like to post a follow up question:
    For example, I am editing the domain xxx.com for Local Safe_mode OFF
    in the httpd.conf, there is a section for xxx.com
    Code:
    <VirtualHost 1.2.3.4:80>
        ServerName xxx.com
        ServerAlias www.xxx.com
        DocumentRoot /home/xxx/public_html
        [blah..blah..blah..]
    </VirtualHost>
    What should I add in the include file??
    should I create a full <VirtualHost> tag in Post_VirtualHost_Include, with
    "php_admin_flag safe_mode Off" ?
    It would be the full <VirtualHost .. > .. </VirtualHost> tag.

  6. #6
    Registered User
    Join Date
    Sep 2006
    Posts
    4

    Default

    I am sorry to bother you again, I followed the documentation, and created a file with path
    /usr/local/apache/conf/userdata/xxx/xxx.com/custom-config.conf

    in the custom-config.conf, I tried the followings but was not successful.
    Would you mind giving me a suggestion? Thank you.

    Code:
    <VirtualHost>
    php_admin_flag safe_mode Off
    </VirtualHost>
    with IP
    Code:
    <VirtualHost 1.2.3.4:80>
    php_admin_flag safe_mode Off
    </VirtualHost>
    only one line:
    Code:
    php_admin_flag safe_mode Off

  7. #7
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    It has to have the full contents of the Virtualhost, not just the setting you want to add/change.

  8. #8
    Member
    Join Date
    May 2008
    Posts
    1,203

    Default

    Quote Originally Posted by hoball View Post
    Hello,
    I have searched over google that it is possible for me to have safe_mode OFF locally, while having it turned ON globally.
    It is done by adding a line to the VirtualHost tag of the domain in httpd.conf:
    Code:
    php_admin_flag safe_mode Off
    Thank you!!
    php safe_mode option is going to be removed from PHP6.

  9. #9
    Registered User
    Join Date
    Sep 2006
    Posts
    4

    Default

    Quote Originally Posted by cPanelDavidG View Post
    It has to have the full contents of the Virtualhost, not just the setting you want to add/change.
    Hello
    the script: /scripts/verify_vhost_includes always return error if the .conf at /etc/httpd/conf/userdata/std/2/xxx/xxx.com/ has the following line:

    php_admin_value safe_mode Off

    sudo /scripts/verify_vhost_includes --show-test-output
    Code:
    Testing /usr/local/apache/conf/userdata/std/2/xxx/xxx.com/custom-config.conf...FAILED
            No changes made without --commit flag
    [TEST RESULTS]
    Syntax error on line 7 of /usr/local/apache/conf/userdata/std/2/xxx/xxx.com/custom-config.conf:
    Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
    
    [/TEST RESULTS]

    It seems to me that the script is not recognizing the flag, however, ignoring this message is fine to apache. the Local Safe Mode is OFF.
    Last edited by hoball; 06-04-2009 at 04:56 AM.

  10. #10
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by hoball View Post
    Hello
    the script: /scripts/verify_vhost_includes always return error if the .conf at /etc/httpd/conf/userdata/std/2/xxx/xxx.com/ has the following line:

    php_admin_value safe_mode Off

    sudo /scripts/verify_vhost_includes --show-test-output
    Code:
    Testing /usr/local/apache/conf/userdata/std/2/xxx/xxx.com/custom-config.conf...FAILED
            No changes made without --commit flag
    [TEST RESULTS]
    Syntax error on line 7 of /usr/local/apache/conf/userdata/std/2/xxx/xxx.com/custom-config.conf:
    Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
    
    [/TEST RESULTS]

    It seems to me that the script is not recognizing the flag, however, ignoring this message is fine to apache. the Local Safe Mode is OFF.
    Hmm, definitely talk to our technical analysts about that. They may be able to do something about that issue: http://tickets.cPanel.net/submit

Similar Threads & Tags
Similar threads

  1. PEAR and safe_mode
    By nazoreen in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-05-2009, 09:14 AM
  2. I want Open Safe_mode for one site
    By A_1 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-07-2007, 09:31 AM
  3. Set Safe_mode On and Off!
    By yawsh in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 01-03-2007, 03:41 PM
  4. PHP safe_mode
    By Echelon17 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-16-2006, 10:00 AM
  5. Howto turn of safe_mode
    By ozzi4648 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-05-2003, 01:40 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube