PHP gone bad


#1

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


#2

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


#3

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


#4

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.


#5

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.