Jump to content

Syntax Error


supertrucker

Recommended Posts

Somewhere in one of my scripts is a syntax error that causes my script to fail. I am getting no indication though of where it may be...I have the following at the very beginning of my script:

ini_set("display_errors", "1");error_reporting(E_ALL);

Is there something else I can do? This bug is driving me nuts, and I'm wasting lots of time hunting down stupid mistakes I've made...Thanks in advance!

Link to comment
Share on other sites

whats the erorr message that you're getting?
That's the problem, I'm not getting any! My script just isn't working because something is wrong (assumed syntax err), but am not getting any error messages..,
Link to comment
Share on other sites

Well, seeing as your web host doesn't display errors.Maybe you can post the script here and see if we can find it.Keep an eye out for:

  • Extra or too few double quotes
  • Missing semi-colons
  • unclosed parenthesis or curly brackets.

Link to comment
Share on other sites

Remember, there are three types of errors: Syntax, Runtime, and Logic. It could be any of those - debug, debug, debug! :)We can help you if we have code to work with.

Link to comment
Share on other sites

If it doesn't parse then you won't see any errors at all, because it doesn't even have a chance to run the code to enable error messages. Connect using FTP and see if there is an error log file that was generated, if errors aren't being displayed then chances are they are going to an error log. You can also put a wrapper around your script to enable errors before you run the script.

<?phperror_reporting(E_ALL);ini_set('display_errors', 1);include 'script.php';?>

If you still don't see anything there, but you're sure there's an error, then it's probably a startup error and is being written to a log somewhere.

Link to comment
Share on other sites

Thank you for the great suggestions! The wrapper worked great, The error generated was for a line where I missed a "//" before a comment :) !!I guess breaks from looking at code for hours on end probably helps too!Now I'm off to find that log file, anybody know what it's called? This is a 4.x version of PHP...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...