Koozali.org: home of the SME Server

PHP base_dir error unable to resolve after many fixes!?

cyberlair

PHP base_dir error unable to resolve after many fixes!?
« on: May 03, 2005, 08:53:13 PM »
Hi everybody.

I have had this error for the longest time and have tried all sorts of fixes I have found on this site to no avail? I cannot run any PHP applications on my site. I have changed the base_dir to / and to the web location e.g /home/e-smith/files/ibays/Primary/html and it still does not work. What will happen is I can access what the web sever needs on / but cannot access directories down from root.

Please help with this issue!

Offline edb

  • *
  • 548
  • +0/-0
PHP base_dir error unable to resolve after many fixes!?
« Reply #1 on: May 04, 2005, 06:38:24 AM »
You will need to answer some questions first.

1)What exactly is your issue and what errors do you encounter when loading a php page?
2)What php version do you have?
3)In what Primary or IBay are you trying to run php pages?

Quote
I have changed the base_dir to / and to the web location e.g /home/e-smith/files/ibays/Primary/html and it still does not work.


Sounds like you are editing the php.ini file or a template fragment?

Try this:
# /sbin/e-smith/db accounts setprop youribayname PHPBaseDir /home/e-smith/files/ibays/youribayname

or if you need a /tmp directory then:
# /sbin/e-smith/db accounts setprop youribayname PHPBaseDir /home/e-smith/files/ibays/youribayname/:/tmp

Then do a
# service httpd restart
......

cyberlair

PHP base_dir error unable to resolve after many fixes!?
« Reply #2 on: May 04, 2005, 02:40:25 PM »
Thank you for your responce.

I have tried what you said and I'm still getting the errors. I have several PHP web sites running.

I am getting 2 types of errors. 1 Error seemes that the base_dir is preventing php from accessing pear.

Warning: main(): open_basedir restriction in effect. File(/usr/share/pear/MDB.php) is not within the allowed path(s): (/home/e-smith/files/ibays/Primary/html) in /home/e-smith/files/ibays/Primary/html/irm/lib/Databases.php on line 4

Warning: main(MDB.php): failed to open stream: Operation not permitted in /home/e-smith/files/ibays/Primary/html/irm/lib/Databases.php on line 4

Fatal error: main(): Failed opening required 'MDB.php' (include_path='.:/usr/share/pear') in /home/e-smith/files/ibays/Primary/html/irm/lib/Databases.php on line 4

The other error seemes to be when I try and upload a document into Owl intranet I get this error.

Warning: copy(): open_basedir restriction in effect. File(/tmp/phpk9ooA8) is not within the allowed path(s): (/home/e-smith/files/ibays/Primary/html) in /home/e-smith/files/ibays/Primary/html/intranet/dbmodify.php on line 930

PHP version 4.3.9-3ld

I use the Primary ibay for all my php sites.

If this cannot be resolved is there a way to completely disable to PHP base_dir security?

Thanks

cyberlair

PHP base_dir error unable to resolve after many fixes!?
« Reply #3 on: May 15, 2005, 07:08:36 PM »
I have finally discovered how to resolve this problem!

 /sbin/e-smith/db accounts setprop Primary PHPBaseDir /home/e-smith/files/ibays/Primary:/tmp:/usr/bin:/usr/share/pear

I required a temp dir and other executable locations to run my php apps. This worked for me. If you need access to another directory just add it :/dirname.

Then save the changes with

/sbin/e-smith/signal-event ibay-modify Primary

 :lol: