PDA

View Full Version : PHP/MySQL Issues


PsyVision
9th November 2005, 19:28
Hey Guys,

I've got a server up and running fine and i've been going through all of the parts testing it, mail works, ftp now works, mysql works okay.

However, PHP/MySQL integration produces these errors (they may be strictly PHP but the files should also access MySQL):

Warning: main() [function.main]: open_basedir restriction in effect. File(/usr/share/pear/config.php) is not within the allowed path(s): (/home/www/web1/) in /home/www/web1/web/scripts/database.php on line 3

Warning: main(config.php) [function.main]: failed to open stream: Operation not permitted in /home/www/web1/web/scripts/database.php on line 3

Fatal error: main() [function.require]: Failed opening required 'config.php' (include_path='.:/usr/share/pear') in /home/www/web1/web/scripts/database.php on line 3

The script database.php on line 3 does:

require('config.php');

The code in config.php just sets some variables, nothing fancy.

This has worked fine on my current web host that I use, I presume I need to wort out some open_basedir restrictions. How do I do this?

Cheers

PsyVision
9th November 2005, 19:37
Okay so changing my line of code to:

require('./scripts/config.php');

Makes it work, albeit with the erros below:

Notice: Undefined index: output in /home/www/web1/web/index.php on line 5

Notice: Use of undefined constant select - assumed 'select' in /home/www/web1/web/scripts/database.php on line 29

I presuming I have some PHP security/error/warning settings too high or something?

On my previous host using the just config.php instead of ./scripts/config.php works fine. Is there some setting that allows me to set a default "base" directory? I'm thinking i need to play with my PHP options...

falko
9th November 2005, 19:38
I guess you have enabled PHP Safe Mode for that web site. Disable it.

till
9th November 2005, 19:49
I presuming I have some PHP security/error/warning settings too high or something?

Yes, set a higher warning level in you php.ini.

PsyVision
9th November 2005, 20:36
Cheers guys.

I've turned on debug messages as PHP wasn't showing anything before.

I'll adjust the default warning level too. and see what happens.