PHP/MySQL Issues

Discussion in 'Installation/Configuration' started by PsyVision, Nov 9, 2005.

  1. PsyVision

    PsyVision New Member

    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):

    Code:
    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:

    Code:
    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
     
  2. PsyVision

    PsyVision New Member

    Okay so changing my line of code to:

    Code:
    require('./scripts/config.php');
    Makes it work, albeit with the erros below:

    Code:
    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...
     
  3. falko

    falko Super Moderator

    I guess you have enabled PHP Safe Mode for that web site. Disable it.
     
  4. till

    till Super Moderator

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

    PsyVision New Member

    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.
     

Share This Page