• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Open Basedir Error

M

medro

Guest
I started to have a big problem with an open basedir error.

If i call a specific PHP Script, my system says:

Warning: main(): open_basedir restriction in effect. File(/webEdition/we/include/we_showDocument.php) is not within the allowed path(s): (/home/httpd/vhosts/antiseptica.info/httpdocs:/tmp) in /home/httpd/vhosts/antiseptica.info/httpdocs/auswahl-flaechen.php on line 16

I run Plesk 7.5.3 on a Suse 9.1 System.

You can check the PHP.info for that domain at:

http://www.antiseptica.info/phpinfo.php

Please help !
 
Plesk configures Apache in a way so PHP can only do file-access in users webroot and /tmp. This is called the open.basedir.

So there is no problem with Plesk here ... you are just trying to run a script which demands more access than it gets.

So you'll have to wonder .. WHY isn't the homedir + /tmp enough ??? Do you really want a script to have more access to the file system ?
 
I hear ya, but, sometimes it's needed. Trust the user and the scripts you install b/f doing this. To answer the question:

You will need to create a vhost.conf file from a text file and put it in the domains' conf directory. vhost.conf should be something like this:

<Directory /home/httpd/vhosts/yourdomain.com/httpdocs>
php_admin_value safe_mode 0
</Directory>

Then run:
/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com

Then restart apache.

That should do it. Sometimes it depends on the php release you are running, you might need to use 'none' instead of '0'.....

-poke
 
Originally posted by poke
I hear ya, but, sometimes it's needed. Trust the user and the scripts you install b/f doing this. To answer the question:

Thanks for the try, but it doesn´t work:

http://www.clikserve.de/webEdition/index.php

And this is, what the logfile says:

[client 80.132.73.47] PHP Warning: main(): open_basedir restriction in effect. File(/webEdition/we/include/we.php) is not with
[client 80.132.73.47] PHP Warning: main(/webEdition/we/include/we.php): failed to open stream: Operation not permitted in /hom
[client 80.132.73.47] PHP Warning: main(): Failed opening '/webEdition/we/include/we.php' for inclusion (include_path='.:') in
[client 80.132.73.47] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/v
[client 80.132.73.47] PHP Warning: main(): open_basedir restriction in effect. File(/webEdition/we/include/we_html_tools.php)
[client 80.132.73.47] PHP Warning: main(/webEdition/we/include/we_html_tools.php): failed to open stream: Operation not permit
[client 80.132.73.47] PHP Warning: main(): Failed opening '/webEdition/we/include/we_html_tools.php' for inclusion (include_pa
[client 80.132.73.47] PHP Warning: main(): open_basedir restriction in effect. File(/webEdition/we/include/we_browser_check.ph
[client 80.132.73.47] PHP Warning: main(/webEdition/we/include/we_browser_check.php): failed to open stream: Operation not per
[client 80.132.73.47] PHP Warning: main(): Failed opening '/webEdition/we/include/we_browser_check.php' for inclusion (include
[client 80.132.73.47] PHP Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/clikserve.de/httpdocs/w
 
It's not about safe mode (check your main php.ini file if it is disabled anyway) ... but you'll have to override / disable the open.base_dir.

Not sure how to do this though.
 
Back
Top