Page 1 of 1

Debugging in PHP5

Posted: Wed Mar 12, 2008 7:50 pm
by bkm_ho
I hope this is the right place to ask questions about debugging!

Im getting a lot of lines similar to the following in my web browser:

Warning: fopen(/localhost/sitelive.com/systems/site/usr/log/security.log) [function.fopen]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sitelive.com\lib\log.php on line 29

I've setup various logs in the correct directory, but still getting the errors. any ideas where to start to debug?

Re: Debugging in PHP5

Posted: Wed Mar 12, 2008 9:38 pm
by Christopher
The "No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sitelive.com\lib\log.php" is pretty specific. Does that file exist? If you open Windows Explorer and paste "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sitelive.com\lib\" into the address bar, do you get a directory with log.php in it?

Re: Debugging in PHP5

Posted: Mon Mar 17, 2008 8:31 pm
by bkm_ho
yes the files i created and put in the directory. however i am not sure if they are correct; i created themand typed .LOG then saved as the various names specified in log.php. they are all php files.

im also getting an fatal error:
Fatal error: Cannot redeclare class DateTime in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sitelive.com\lib\datetime.php on line 3

could this be something to do with the way apache is set up?

Re: Debugging in PHP5

Posted: Mon Mar 17, 2008 9:19 pm
by Christopher
You are using a Unix path "/localhost/sitelive.com/systems/site/usr/log/security.log" on a Windows system.

Re: Debugging in PHP5

Posted: Tue Mar 18, 2008 1:45 pm
by Weirdan
Fatal error: Cannot redeclare class DateTime in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sitelive.com\lib\datetime.php on line 3
Recently php introduced builtin DateTime class - so you can't use this name for your own classes anymore.