• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

PEAR open_basedir trouble

H

hegebutt

Guest
I'm trying to use PEAR, but I'm getting the following error:

Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/HTML/Template/ITX.php) is not within the allowed path(s): (/home/httpd/vhosts/yumyumweb.com/subdomains/itns/httpdocs:/tmp) in /home/httpd/vhosts/yumyumweb.com/subdomains/itns/httpdocs/wda2-book/wda/ch10/example.10-1.php on line 2

Reference:
http://itns.yumyumweb.com/wda2-book/wda/ch10/example.10-1.php

I read some other posts in this forum and created a vhost.conf file in /home/httpd/vhosts/yumyumweb.com/subdomains/itns/conf, which looks like this:

<Directory /home/httpd/vhosts/yumyumweb.com/subdomains/itns/httpdocs>
php_admin_value open_basedir /home/httpd/vhosts/yumyumweb.com/subdomains/itns/httpdocs:/tmp:/usr/share/pear
</Directory>

I then restarted httpd, but I'm still getting the error that there's a restriction.

Here's my phpinfo:
http://itns.yumyumweb.com/phpinfo.php

It seems like this should work, so I'm stumped. Ideas?
 
Sorry about this post, must have not been searching correctly yesterday, because today I found the answer to my problem in another post.

In case anyone stumbles upon this post looking for the answer, here it is:

After creating the vhost.conf and/or vhost_ssl.conf files, you must run the command:
/usr/local/psa/admin/bin/websrvmng -u --vhost-name=domain.com
(replace domain.com with the name of the domain)

Then restart the Apache service. Then the changes will take effect.
 
common errors & filling in the blanks.

I spent about 8 hours reading various post with tons of trial and error to figure this out. Some of things I've learned which may help others.

1) creating the vhost.conf file
Everyone assumes everyone know how to create this file.

# cd /home/httpd/vhosts/domain.com/conf
ls -l (this will show you all the files in the folder.

# touch vhost.conf
Hit enter and the file is created, after you've created the file.

# vi vhost.conf
Type (Shift+c)

This allows you to edit the file

(Shift+c) allows you to insert the text in the file. Enter the information you have scene for what should be in the file hit (Esc) then (Shift):wq to save your changes.

2) Make sure to enclose the file path after open_basedir "file path"

3) Make sure that you create a file called vhost.conf and not vhosts.conf. Simple as it seems it happens.

Other than that you should be good, I worked on this thing so long I can't be sure which or exactly what was needed plan to go back through and back stuff out to see when it stops working, but overall the information is on here to get it working.
 
Back
Top