?
Solved

Plesk, PHP and open_basedir

Posted on 2011-02-23
4
Medium Priority
?
882 Views
Last Modified: 2012-05-11
I have a linux server with plesk, and I configured the main settings in the web interface. I know how to configure a webserver manually, but plesk is new to me.

The problem is that when i try to execute a php file, it answers me "500, internal server error".
In the virtualhost logs i can see


PHP Warning:  Unknown: open_basedir restriction in effect. File(/var/www/vhosts/websitedomain.com/httpdocs/index.php) is not within the allowed path(s): (/var/www/vhosts/websitedomain.com/httpdocs/:/tmp/) in Unknown on line 0

Open in new window



Note that the path specified is the right path, and my script is there. That the script doesn't include anything, I even tried with a ".php" file without any instructions. The error is the same.

I found the vhost files created by plesk in
/opt/psa/admin/conf/ip_vhosts_bootstrap.conf
that includes
/var/www/vhosts/websitedomain.com/conf/12984710050.82661300_httpd.include
and in this the complete virtualhost configuration, and the basedir setting.

I cannot modify them manually (as written at the top of the files), and i think that the right open_basedir should not be a problem for my website.

What's the problem? Any help appreciated!

Thanks
0
Comment
Question by:LAMASE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 34961161
Any chance you have "safe mode?"
http://php.net/manual/en/features.safe-mode.php
0
 
LVL 4

Author Comment

by:LAMASE
ID: 34961192
Nope.
From the vhost file (/var/www/vhosts/websitedomain.com/conf/12984694820.65854400_httpd.include):

php_admin_flag safe_mode off
php_admin_value open_basedir /var/www/vhosts/websitedomain.com/httpdocs/:/tmp/

Open in new window


I also searched the whole filesystem for safe_mode and never found it "on"
0
 
LVL 4

Accepted Solution

by:
LAMASE earned 0 total points
ID: 34979559
I had to solve by myself: i created a file called
/var/www/vhosts/websitedomain.com/conf/vhost.conf

Open in new window

that overwrites open_basedir directive:

Content of the file:
<Directory /var/www/vhosts/websitedomain.com/httpdocs/>
php_admin_value open_basedir none
</Directory>

Open in new window


Don't know why the right open_basedir didn't work. Not time to think to this at the moment... but now it works.
0
 
LVL 4

Author Closing Comment

by:LAMASE
ID: 35015390
Solved by myself, not in the clean way but the quick one.
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question