Solved

Plesk, PHP and open_basedir

Posted on 2011-02-23
4
865 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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 …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

746 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