• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Local PHP Safe Mode in httpd.include or vhost.conf?

D

drc15

Guest
Hi,

I have a vhost setup in which there are 2 files in my conf folder of my virtual host: httpd.include and vhost.conf

I need to make sure my PHP safe mode local is set to 'Off' in the httpd.include file, but when I edit this file the header of the file tells me not to edit the file but put my settings in the vhost.conf file.

I already have some basic settings in my vhosts.conf file, but how do I put the following sections,

<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "xxxx"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "xxxx"
</IfModule>

in the vhosts.conf file when those sections above are between <Directory> tags and my include vhosts.conf line is outside these <Directory? tags?

The problem I am finding is because I am on a virtual server box from 1&1 I am finding that the settings in the httpd.include file get changed, so I need to make sure they don't by setting the details in the vhosts.conf file.

Thanks

Daniel
 
Sorry if I misunderstand, but the lines needs to go inside the <Directory> tags.

Don't forget to restart apache after you make the change to the vhost.conf file.
 
So are you saying that I can dump most of the http.include file contents into the vhosts.conf file, and all will still be ok?

Such as putting everything between the <Directory> tags into my vhosts.conf file?

Dan
 
i have a customer asking us to turn off PHP safe mode for their domain. Is this possible for a single domain?

Their problem is that when they upload files, the permissions prevent files from being accessed and amended. We had to set all files with permission 744, but any new files are still being given a different default that they wish to amend.

If you can give me some instructions of how to achieve this as well, I would be most grateful.
 
For safemode you can do this via Plesk.

Login to plesk, click on the domain you need to turn safemode off on and then click on "setup" under "hosting"... Now you will see a checkbox next to "PHP Support", uncheck it to turn safe mode off and restart apache.... All done :)
 
Back
Top