PHP gone bad

PHP gone bad

Posted by: pdg
Posted on: 2005-08-08 20:04:00

All of a sudden all of my PHP scripts which "require_once('DB.php');" have broken! All they return is the following

Warning: main(DB.php) [function.main]: failed to open stream: No such file or directory in /home/.waddlesheater/pdg/sbox.net/wine/new_member_2.php on line 19

Fatal error: main() [function.require]: Failed opening required 'DB.php' (include_path='.:/usr/local/php5/lib') in /home/.waddlesheater/pdg/sbox.net/wine/new_member_2.php on line 19

Line 19 is

require_once('DB.php');

They worked this morning!

Anyone have any clues?

Thanks for your time,
Paul

Re: PHP gone bad

Posted by: rlparker
Posted on: 2005-08-08 22:48:00

If the scripts *were* working, and suddenly began generating the indicated error messages without you changing anything (such as changing the setting to run PHP as CGI, or changing from PHP4 to PHP5), I suspect your DH managed "dataglob" might have changed.

While it doesn't happen often, DH *used* to caution you that the "dataglob" was subject to change, and that, if your scripts reference the "dataglob" implicitly, your scripts could break.

It looks to me as though that might have happened with your scripts, since the error messages indicate the script is having trouple locating files in the path.

The "dataglob" is the part of your path that starts with the period (from your error messages, the /.waddlesheater/ element).

Try changing your paths in your scripts to *omit* the dataglob references (/.waddlesheater). Your scripts should still work without the /.waddlesheater part, and would not break if/when DH cahnged your "dataglob".

Good Luck, and let us know what happens.

--rlparker


Re: PHP gone bad

Posted by: pdg
Posted on: 2005-08-09 05:07:00

rlparker,

The PHP line where my scripts go bad is simply

require_once('DB.php');

I can't omit anything.

I did change to PHP5, but that was a few days ago.

Thanks,
Paul

Edited by pdg on 08/09/05 05:23 AM (server time).

Re: PHP gone bad

Posted by: everinjoy
Posted on: 2005-08-09 15:52:00

Can you post the surrounding code? PHP errors often reference the line number where it would expect to find the item that would fix the error (e.g. a closed IF or some such), not the line where the error itself actually is.

Also, double-check that the file is there, case-sensitive, and that the permissions aren't screwed up.

You could also try include_once instead.

Re: PHP gone bad

Posted by: photon
Posted on: 2005-08-09 21:25:00

I've got this also suddenly tonight, although with slight variations.

Suddenly:
- phpBB forums stop working (can't connect to the database, invalid host name. Tried connecting to the database on the command line, still no go)
- Other pages are having problems loading PEAR

Please don't let this go over night.

Tags: php includephp scriptsphp functionnew memberopen streamphp5usrlibpath