November 4th, 2012, 05:33 AM
910814 - how to find my php errors?
like what VS does for C++ source codes with Build (F7) command, i need a way to find errors and warnings a php code may consist of. since i'm an absolute newbie in programming with php, i need an assistant program for show me where i'm wrong.
is there any?
November 4th, 2012, 06:44 AM
Welcome to DevShed, hamidi.
Unfortunately there is no way to precisely track your logic or syntax errors in PHP, due to the fact that it is based solely on the 1950's ALGOL system language. You will need to remove one line at a time to see if your error goes away, which will most likely cause multiple other errors, which will then need to be addressed in the same manner. This is how you handle PHP errors.
Just kidding. Add these lines to the top of your code.
November 4th, 2012, 06:58 AM
Originally Posted by Winters
just kidding I said, what's going on ?
November 4th, 2012, 07:17 AM
hmm, i couldn't figure out. u mean adding the two lines at the top of my php file may show me the error occurred? if so, how can i see it? does it causes apache to log errors occurred in /var/log/apache2/error.log?
kidding is ok, but consider that a beginner is confused enough with many things
what i do is that i add a function as service to my php file at server and register it. then i go to VS to UpdateWebReference. i expect Reference.cs be updated with the function. but it doesn't cause it to include the function. during this, i guess there must has occurred an error.
how can i find that?
November 4th, 2012, 07:25 AM
apache log is register all errors...So, you should use on the top of page the above code.which would say you all errors that you made.
Originally Posted by hamidi
November 4th, 2012, 09:09 AM
Those two lines will cause PHP to output the error to the screen when you execute the file. However, if your error is a syntax error rather than a runtime error it won't work, you need to adjust your php.ini file and set those two configuration parameters.
I didn't follow this whole section.