Global safe_mode ON, want Local safe_mode OFF

hoball

Registered
Sep 13, 2006
4
0
151
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!!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
11
313
Houston, TX
cPanel Access Level
Root Administrator
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/easyapache/customdirectives.html

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

PlatinumServerM

Well-Known Member
PartnerNOC
Jul 10, 2005
400
3
168
New Jersey, USA
cPanel Access Level
Root Administrator

hoball

Registered
Sep 13, 2006
4
0
151
As httpd.conf says, use the include files. Here's information on using includes:

http://www.cpanel.net/documentation/easyapache/customdirectives.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 [url]www.xxx.com[/url]
    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" ?
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
11
313
Houston, TX
cPanel Access Level
Root Administrator
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 [url]www.xxx.com[/url]
    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.
 

hoball

Registered
Sep 13, 2006
4
0
151
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
 

thewebhosting

Well-Known Member
May 9, 2008
1,201
1
68
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.
 

hoball

Registered
Sep 13, 2006
4
0
151
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:

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
11
313
Houston, TX
cPanel Access Level
Root Administrator
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