• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Getting Desperate, open_basedir Restriction killing me

R

rmataka

Guest
Hi EveryOne

I havent posted to this here in a while, but im having a very big problem. It seems that nothing i do disables open_basedir restriction... i tryed

1) * Setting the php.ini file to open_basedir /
* restarting Plesk

2) * Commenting out the php.ini file to ;open_basedir
* restarting Plesk

3) * Setting the vhost.conf file to open_basedir /
* /usr/local/psa/admin/bin/websrvmng -a -v
* restarting Plesk

4) * Setting the vhost.conf file to open_basedir none
* /usr/local/psa/admin/bin/websrvmng -a -v
* restarting Plesk


The main problem is, I need to include /usr/share/pear/ because im using the PayPal API which requires PEAR.php base class.

so as a last resort I tried

5) * Setting the vhost.conf file to open_basedir /tmp:/usr/share/pear/
* /usr/local/psa/admin/bin/websrvmng -a -v
* restarting Plesk

No Luck!!

I'm running out of options here, i need open_basedir Totally Shut off
Can some one please help me here.

By the way Im running Plesk 7.5.4 on centOS 4

Thanks
Rich
 
No, you do not need open_basedir totally shut off to be able to use PEAR. You just need to add /usr/share/pear to the open_basedir path for the domain.

1. Go to SWsoft's Knowledge Base
2. Search for 'open_basedir'
3. Bingo!

Works for me.
 
Didnt solve ...

Any more tips ? It didnt solve. open_basedir has new directories but still gives the same error.

Any tips ?

Joao Correia
 
What did you put in your /var/www/vhosts/domain.com/conf/vhost.conf? It should be something like this (replace domain.com with your domain, replace /var/www with /home/httpd if that's where your vhosts are located):

Code:
<Directory /var/www/vhosts/domain.com/httpdocs>
php_admin_value open_basedir /var/www/vhosts/domain.com/httpdocs:/tmp:/usr/share/pear
</Directory>

Save the file, run websrvmng -av and restart apache.
 
The code is the same

I have in there now


<Directory /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "/usr/local/psa/home/vhosts/comp-u\
-clinic.com/httpdocs:/tmp:/usr/share/pear/"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_value open_basedir "/usr/local/psa/home/vhosts/comp-u\
-clinic.com/httpdocs:/tmp:/usr/share/pear/"
</IfModule>
</Directory>



I also tryed

<Directory /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir "/usr/local/psa/home/vhosts/comp-u\
-clinic.com/httpdocs:/tmp:/usr/share/pear/"
</Directory>



Still nothing... so fustrating
 
Is the path on a single line? Like this?

Code:
<Directory /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs:/tmp:/usr/share/pear
</Directory>

Other than that it looks like it should work. You did run websrvmng to make sure vhost.conf is included in the domain's httpd.include and restart apache?
 
Yes

Yes it is on the same line

PHP:
<Directory /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs:/tmp:/usr/share/pear
</Directory>

I also tried

PHP:
<IfModule sapi_apache2.c>
<Directory /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs>
php_admin_flag engine on
php_admin_value open_basedir "/usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs:/tmp:/usr/share/pear/"
</IfModule>
</Directory>

I did run

/usr/local/psa/admin/bin/websrvmng -a -v

and i did

/etc/rc.d/init.d/psa stopall

then a

/etc/rc.d/init.d/psa start

I just dont get why it wont work...
thanks for your help man

rick
 
opps i ment

PHP:
<Directory /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "/usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs:/tmp:/usr/share/pear/"
</IfModule>
</Directory>

sorry
 
Do you know where the logs are for apache, i cant find the the error_log and the access_log
 
Never mind found them

tail error_ssl_log


[Tue Oct 03 12:55:25 2006] [error] [client 24.168.40.145] PHP Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.:/usr/share/pear:includes/paypal_sdk/') in /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs/includes/paypal_sdk/PayPal.php on line 11, referer: https://www.comp-u-clinic.com/checkout_confirm.php


Im not sure why its not working I get this error in the browser

PHP:
Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/PEAR.php) is not within the allowed path(s): (/usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs:/tmp) in /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs/includes/paypal_sdk/PayPal.php on line 11

Warning: main(PEAR.php): failed to open stream: Operation not permitted in /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs/includes/paypal_sdk/PayPal.php on line 11

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='.:/usr/share/pear:includes/paypal_sdk/') in /usr/local/psa/home/vhosts/comp-u-clinic.com/httpdocs/includes/paypal_sdk/PayPal.php on line 11

This really suks
 
It seems the open_basedir statement in your vhost.conf is not applied.

* What if you remove the IfModule lines (and restart apache)?
* Did websrvmng add the line Include /usr/local/psa/home/vhosts/comp-u-clinic.com/conf/vhost.conf to /usr/local/psa/home/vhosts/comp-u-clinic.com/conf/httpd.include?
 
Oh Snap

Thanks A Million i think you helped me figure the problem out

Under

comp-u-clinic.com:80
there is an include add
Include /usr/local/psa/home/vhosts/comp-u-clinic.com/conf/vhost.conf


BUT!!

Under comp-u-clinic.com:433

there is no
Include /usr/local/psa/home/vhosts/comp-u-clinic.com/conf/vhost.conf


And im recieving the open base under https!!
i think thats it

I need to add vhost vhost_ssl.conf
With the same directives

Let me try brb
 
!!! THANKS !!!

You said the magic words

Did websrvmng add the line Include /usr/local/psa/home/vhosts/comp-u-clinic.com/conf/vhost.conf to /usr/local/psa/home/vhosts/comp-u-clinic.com/conf/httpd.include?


Thats what triggered it...

Open base was resticting https not http... and i checked the option
to host HTTP and SSL within the same dir /httpdocs/

Thanks a million!! I you ever need help give me a holla
 
Ah, we're talking about HTTPS. Then you should create a vhost_ssl.conf instead of a vhost.conf and websrvmng will take care of adding the include to the correct section. Be sure to change httpdocs to httpsdocs as well.

Glad it's working now, but I'd change it around to using vhost_ssl.conf instead so you know Plesk won't break it sometime in the future.
 
you mean changing the httpdocs dir to httpsdocs? becuase i checked the option in hosting setup to host SSL under the same dir.

But i dont know if the same dir is referring to httpsdocs or httpdocs


Thanks Man
 
Ah ok, if you're using the httpdocs dir for SSL content as well you don't need to change httpdocs to httpsdocs.
 
Thanks for your help, 2 brains troubleshooting is alot better then 1
Thanks Alot
 
Back
Top