473,386 Members | 2,042 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PHP/Pear Problem - help please!

I have pear installed on my web server. The problem is, I can't seem
to get it working!

Whenever I try to call one of the installed packages, for example:

require_once "DB.php";

I get the following error:

Warning: main(): open_basedir restriction in effect.
File(/usr/share/pear/DB.php) is not within the allowed path(s):
(/var/www/vhosts/xentek.co.uk/httpdocs:/tmp) in
/var/www/vhosts/xentek.co.uk/httpdocs/wda2-winestore/index.php on line
19

The value of my phpInfo(); says the following for open_basedir:

open_basedir | /var/www/vhosts/xentek.co.uk/httpdocs:/tmp | no value

This problem seems to be mentioned often when I did a search, but I
could not find any solution!

Please help if possible, I've spent too long already trying to get this
working!

Regards,
--
RH

Feb 25 '06 #1
4 1984
NC
ru************@sashait.co.uk wrote:

Whenever I try to call one of the installed packages, for example:

require_once "DB.php";

I get the following error:

Warning: main(): open_basedir restriction in effect.
File(/usr/share/pear/DB.php) is not within the allowed path(s):
(/var/www/vhosts/xentek.co.uk/httpdocs:/tmp) in
/var/www/vhosts/xentek.co.uk/httpdocs/wda2-winestore/index.php
on line 19


You need to modify your php.ini. Right now, it has a line that says:

open_basedir = /var/www/vhosts/xentek.co.uk/httpdocs:/tmp

Modify it to the following:

open_basedir =
/var/www/vhosts/xentek.co.uk/httpdocs:/tmp:/usr/share/pear

Alternatively, you can simply disable safe mode...

Cheers,
NC

Feb 25 '06 #2
Thanks, I did as you suggested and set open_basedir to what you said
above in my php.ini file. Unfortunately, it seems to being overridden
at some stage?

You can view my phpInfo for the server by visiting:
http://www.xentek.co.uk/wda2-winestore/

You can see the values for open_basedir are now:
open_basedir /var/www/vhosts/xentek.co.uk/httpdocs:/tmp /var/www/vhosts/xentek.co.uk/httpdocs:/tmp:/usr/share/pear

Any ideas why my php.ini is being overridden?

Feb 25 '06 #3
NC
ru************@sashait.co.uk wrote:
I did as you suggested and set open_basedir to what you said
above in my php.ini file. Unfortunately, it seems to being overridden
at some stage?

You can view my phpInfo for the server by visiting:
http://www.xentek.co.uk/wda2-winestore/

You can see the values for open_basedir are now:
open_basedir
/var/www/vhosts/xentek.co.uk/httpdocs:/tmp
/var/www/vhosts/xentek.co.uk/httpdocs:/tmp:/usr/share/pear

Any ideas why my php.ini is being overridden?


First, try restarting Apache if you didn't already.

If that doesn't help, check your httpd.conf. It may have a line like
this:

php_admin_value open_basedir /var/www/vhosts/xentek.co.uk/httpdocs:/tmp

open_basedir is a PHP_INI_SYSTEM directive, meaning that it can be set
only from php.ini or httpd.conf.

If this doesn't help (which is unlikely), check other .ini files parsed
by PHP; your phpinfo() output lists them:

/etc/php.d/domxml.ini,
/etc/php.d/imap.ini,
/etc/php.d/ldap.ini,
/etc/php.d/mbstring.ini,
/etc/php.d/mysql.ini,
/etc/php.d/odbc.ini,
/etc/php.d/pgsql.ini,
/etc/php.d/snmp.ini,
/etc/php.d/xmlrpc.ini

Cheers,
NC

Feb 25 '06 #4

NC wrote:
ru************@sashait.co.uk wrote:

Any ideas why my php.ini is being overridden?
First, try restarting Apache if you didn't already.


Yes, I'd restarted the server.
If that doesn't help, check your httpd.conf. It may have a line like
this:

php_admin_value open_basedir /var/www/vhosts/xentek.co.uk/httpdocs:/tmp

open_basedir is a PHP_INI_SYSTEM directive, meaning that it can be set
only from php.ini or httpd.conf.
There's no mention of open_basedir in my httpd.conf file, sadly.
If this doesn't help (which is unlikely), check other .ini files parsed
by PHP; your phpinfo() output lists them:

/etc/php.d/domxml.ini,
/etc/php.d/imap.ini,
/etc/php.d/ldap.ini,
/etc/php.d/mbstring.ini,
/etc/php.d/mysql.ini,
/etc/php.d/odbc.ini,
/etc/php.d/pgsql.ini,
/etc/php.d/snmp.ini,
/etc/php.d/xmlrpc.ini


Each of these files is used to enable an extension.

So, I'm stuck on this one. Thanks for your help. I don't suppose
there's anything else I should try?

Kind regards,
--
RH

Feb 25 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Arne Kösling | last post by:
Hi ! I am new to Web Services. Therefore I ve set up a PHP Installation on Windows (PHP 4.3.2 and Apache 1.3.29). I have tested PHP alone and then installed PEAR. Now I am stuck there (Before...
0
by: kain | last post by:
hi there, I'm currently converting a MySQL application to PostgreSQL, and I hacked this app to support PEAR::Db . after some good coding days, I've found a problem: mysql_insert_id on pear::db ....
0
by: Analysis&Solutions | last post by:
Greetings: Crack open the beer, PEAR DB 1.6.0 is here! (Hey, I'm a bit giddy with excitement that my intense work during the past seven weeks has come to fruition.) For those unfamiliar with...
3
by: David | last post by:
I installed the Pear program and set the include path in php.ini to point to the pear dir. I have a program which <? require_once("DB.php"); ?> This produces the error "Class 'PEAR_Error'...
2
by: Alan Prescott | last post by:
I'm running SuSE Linux 9.3, fully up to date running # pear install db responds with ... downloading DB-1.7.6.tgz ... Starting to download DB-1.7.6.tgz (124,807 bytes)...
0
by: Mike | last post by:
WinXP Pro SP2 PHP 4.1.1 from php.net Installed on D:\php\ I have tried several times to install PEAR in PHP 4.1.1. I keep getting an error and I am not proficient enough to be able to fixit...
5
by: Jim Michaels | last post by:
I downloaded a PEAR module, but it came with this XML file and a PHP file. I figure I just include the PHP file somehow, but what do I do with the XML file?
2
by: yawnmoth | last post by:
The PHP license states the following: 4. Products derived from this software may not be called "PHP", nor may "PHP" appear in their name, without prior written permission from group@php.net. ...
5
by: crescent_au | last post by:
Hi all, I've been using PHP for a while now but I haven't actually used PEAR. I have just read half a chapter in a book, it sounds alright but haven't actually used it. I was just wondering, is...
1
by: IchBin | last post by:
I remember having problems with pear when I first installed it but got it running some time ago. This is on a windoze XP SP OS. I did not think it was correct because it pointed to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.