Solved

Plesk, PHP and open_basedir

Posted on 2011-02-23
4
868 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
  • 3
4 Comments
 
LVL 108

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use md5 hashing 3 25
Load google maps api into wordpress 5 35
PHP warning 4 27
How to loop bootstrap columns which contain database records 9 18
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

930 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now