LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-08-2004, 09:17 AM   #1
craddy
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Rep: Reputation: 0
php pear problem


Hello,

I have recently moved my website from a hosed package on oneandone.co.uk to a dedicated server (for space + bandwidth + the chance to learn). But I am having a problem with Pear DB access through PHP.

The original website works fine at http://swdl.org but when I changed the links and copied it to the dedcated server it throws up errors:

Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/DB.php) is not within the allowed path(s): (/home/httpd/vhosts/mynetdesk.org/httpdocs:/tmp) in /home/httpd/vhosts/mynetdesk.org/httpdocs/db_connect.php on line 5

Warning: main(DB.php): failed to open stream: Operation not permitted in /home/httpd/vhosts/mynetdesk.org/httpdocs/db_connect.php on line 5

Fatal error: main(): Failed opening required 'DB.php' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/mynetdesk.org/httpdocs/db_connect.php on line 5

See for yourself at http://mynetdesk.org.

If anyone could help me identify / solve the problem I'd really apreciate it! php info at http://mynetdesk.org/info.php.

Thanks,

Richard Craddock

Last edited by craddy; 11-08-2004 at 01:51 PM.
 
Old 11-09-2004, 03:28 PM   #2
wipe
Member
 
Registered: Jun 2004
Location: High Green
Distribution: Fedora Core 4
Posts: 180

Rep: Reputation: 30
Hi, it looks like your PHP settings are different from the ones on the previous server. The "open_basedir restriction" is a security measure to deny your scipts access to files outside some defined directory tree(s). You may have to adjust the open_basedir directive in your httpd.conf (or perhaps php.ini) file by, for example, adding :/usr/share/pear/ to the end of the string.

See the manual:

http://www.php.net/manual/en/feature...i.open-basedir

My settings files are in:

/etc/httpd/conf/httpd.conf
/etc/php.ini

I hope this helps.

Simon

EDIT: The httpd.conf file may also source other configuration files like this: Include conf.d/*.conf.

Last edited by wipe; 11-09-2004 at 03:35 PM.
 
Old 11-09-2004, 04:32 PM   #3
craddy
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Original Poster
Rep: Reputation: 0
Ahh! That makes so much sense! Thanks loads!

It seems to have solved the problem! However it has exposed another!

When I try to login the login page just reappears with no information in, it doesn't log me in. I think this is another server configuration problem as horde suffers the same problem!

Any ideas on what might be causing this? Horde technical support sugested that register globals might be off (which it was) but turning it on hasn't fixed the problem so couldit be something related?


Cheers,

Craddy
 
Old 11-09-2004, 05:54 PM   #4
wipe
Member
 
Registered: Jun 2004
Location: High Green
Distribution: Fedora Core 4
Posts: 180

Rep: Reputation: 30
If there's no error message on the screen, it can usually be found somewhere else. I'd start by looking at Apache's error log (/var/log/httpd/error_log) or some other log, possibly defined in php.ini. PHP scripts can also have their own error handlers. Then I would search the Internet, LinuxQuestions.org and the PHP manual with some suitable looking piece of the error message.

You might try turning open_basedir off altogether. I'm looking at your phpinfo() page and it looks a bit funky now - open_basedir is only /usr/share/pear/. It's in the Master Value column too, which I guess is bad because it's a site-wide setting (?). The cause might ofcourse be some other configuration directive or wrong permissions/ownership on some files or directories that the script needs.

Hopefully someone who has had similar problems sees this thread.

Simon

Last edited by wipe; 11-09-2004 at 05:55 PM.
 
Old 11-09-2004, 08:25 PM   #5
craddy
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Original Poster
Rep: Reputation: 0
I have done this (being turning off open base dir). There was a local one that was turning it off anyway, but that was only on this domain. I'll continue searching for the solution, but any ideas please let me know!


Thanks loads,

craddy
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 4 and Pear on suse 10... jsheffie SUSE / openSUSE 2 03-07-2006 06:40 AM
urpmi and php-pear Huppybanny Linux - Newbie 9 10-19-2005 08:15 AM
Mandrake 10.1 Apache2 with PHp and pear problem Jediman Linux - Software 10 04-19-2005 03:35 PM
Trouble with PHP & Pear Gerardoj Programming 0 10-17-2004 03:30 PM
php pear quickforms question BaerRS Programming 1 02-19-2004 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration