Remove open_basedir restriction for a specific domain in Plesk


/ Published in: Apache
Save to your folder(s)

If you have an open_basedir restriction that is causing issues with a domain, you can remove the restriction easily. First, put the following text in /home/httpd/vhosts/[domain]/conf/vhost.conf:


Copy this code and paste it in your HTML
  1. <Directory /home/httpd/vhosts/[domain]/httpdocs>
  2. php_admin_flag engine on
  3. php_admin_value open_basedir none
  4. </Directory>
  5.  
  6. # If there was already a vhost.conf in the directory, then just reload Apache. Otherwise, run the magic wand:
  7.  
  8. /usr/local/psa/admin/bin/websrvmng -av
  9.  
  10. # Then bounce Apache:
  11.  
  12. /etc/init.d/httpd reload
  13.  
  14. # BUT, if the client has both php4 and php5 things get a little more complicated, and you have to add the "IfModule" directive from the apache syntax, e.g.:
  15.  
  16. < Directory /var/www/vhosts/domain.com/subdomains/SUBDOMAIN/httpdocs>
  17. < IfModule sapi_apache2.c>
  18. php_admin_flag engine on
  19. php_admin_flag safe_mode off
  20. php_admin_value open_basedir none
  21. < /IfModule>
  22. < IfModule mod_php5.c>
  23. php_admin_flag engine on
  24. php_admin_flag safe_mode off
  25. php_admin_value open_basedir none
  26. < /IfModule>
  27. Options +Includes -ExecCGI
  28. < /Directory>
  29.  
  30. # Or if you want to add a new location to open_basedir instead of disabling open_basedir, you would have:
  31.  
  32. php_admin_value open_basedir "/var/www/vhosts/domain.com/httpdocs:/tmp:/new/path/comes/here"

URL: https://www.solarvps.com/forums/index.php?topic=359.0

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.