PDA

View Full Version : errors messages not being displayed



ali
09-07-2004, 05:11 AM
Hi.
I'm just getting started with using Php and Mysql.But my problem is,that whenever my script has an error,no error message is displayed.Only a blank page with nothing on it shows up,and I have to look through all of my code to find the line that caused the error.It really wastes a lot of time.Is it the same with you guys?(i'm refering to the west host clients here).If yes,does anybody know how to configure it so it displays an error message whenever an error occurs?

FZ
09-07-2004, 05:42 AM
ali,

Yes, a blank page is the default behaviour when there is an error in your code. To change that have a look at this: http://forums.westhost.com/phpBB2/viewtopic.php?t=2074

ali
09-07-2004, 05:47 AM
Thanks :D

ali
09-07-2004, 05:54 AM
Hey,I tried it but for some reason,WSFTP(my ftp program) is treating php.ini as a directory instead of a file,and I'm unable to retreive it/edit it.What should I do now?

ali
09-07-2004, 05:56 AM
Also,the method you mentioned logs the errors to a log file,and i want it to print the error on the screen because it would still take a lot of time to check the log.Do you know of any way I could do that?
I really appreciate your help.

wildjokerdesign
09-07-2004, 07:51 AM
Try looking in /ftp/usr/lib/ for your php.ini The other links you see are sym links to the location. That should let you work with the actual file. You might also try Jalal's code for turning on errors in a singel script. I have used that before and it is much easier.

FZ
09-07-2004, 08:44 AM
ali,

Jalal's method (specifically ini_set("display_errors", 1);) should display the error(s) in your browser. If you are using the "global" method I described, then you would change (in your php.ini file) display_errors = Off to On.

Thanks for grabbing that one, Shawn. All these symlinks are confusing...

wildjokerdesign
09-07-2004, 09:16 AM
No problem FZ. It is interesting that in my FTP program I can download the file via a symlink. i.e. if I can move the file to my local computer via the /ect/php.ini symlink. Not sure if I could upload it the same way since I have never tried. Wonder if it depends on the setting in your FTP program. I may have mine set to follow a symlink or some such thing.

ali, let us know how it works out for you and if you need anything else.

ali
09-07-2004, 05:08 PM
thanks guys.It worked! :D

ali
09-07-2004, 05:15 PM
i'm going to turn it off after the debugging though,and for anyone else who reads this they should as well,because you dont want your visitors to see sensitive information about your script whenever an error occurs ;)

FZ
09-07-2004, 05:29 PM
Glad you got it working, ali. As you mention it is "sensitive information" that is revealed, which is why it is always off by default. I think it is helpful to keep error logging on though, so you can look over it once in a while to make sure there aren't any problems you're not picking up on in your script(s).