Forum Moderators: coopster

Message Too Old, No Replies

PHP error but no error message

what's going on?

         

too much information

5:08 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am about 6 hours into PHP. I am converting my site from ASP and thought it would be a fairly simple thing to do, but...

I am trying to build a table dynamically from a list of files in a directory and my script isn't working. The worst part is that I just get a blank page, no source, no error message, etc. If I had an error message I could probably figure it out, what's going on, is this normal?

Is there a way to turn on error messages?

grandpa

5:34 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Put this at the top of your code.

error_reporting(E_ALL);

You'll find some really useful info over here too [webmasterworld.com].

too much information

11:56 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the help!

too much information

1:14 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ok, still not seeing the errors though. I did find this on the web:

If the php.ini has display_errors turned off, you can always use the ini_set command to change it at runtime.

ini_set("display_errors","1");

I am not where I can test it right now, but it looks promising.

hakre

2:37 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i guess you're not getting any error message, because there is no error. error_reporting(E_ALL); should do the trick anyways, so ini_set() is not promising at all.

i guess 2nd part: you script is in a loop and that's why it does not return anything because it's still running. what kind of os you're using? *nix based or win?

too much information

4:47 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's on a linux server.

It could be that it is a loop problem. I just finished a cleaner script that should solve the problem, I'll give it a try. If that doesn't work I'll post some code.

All I'm trying to do is get the names of directories in a certain directory, and use those names to create links to the content within them. (a dynamic image gallery type thing)

Timotheos

4:54 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is about the time I start putting in echo statements to see where my script is at.

echo "starting";
.
.
.
echo "loop";
.
.
.
echo "finished";

jatar_k

5:53 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I spent a few hours yesterday debugging a script with the uncanny ability to 'die the silent death'.

I always approach these the same way, line by line.

Take a look at your logic, start at the beginning and step through it line by line, include by include using echo's and such to see how far the script gets, then let it go a little farther if you dont see any problems.

Eventually you will be able to isolate the error and start fixing it.

grandpa

5:58 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Timotheos beat me to it. I did that very thing last night after getting a blank page. Somewhere in between my functions and my code I was losing my customer id. The code worked great, no errors to report. That sounds like your problem, more than a loop even. You would probably recognize a performance hit if you got into a bad loop situation.

too much information

6:13 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yea, I just re-wrote the entire thing and it works, I just need to narrow the results a bit to get the files I need.

Thanks for your help. PHP isn't as bad as I thought it would be. It is different, but hard to pick up.