Reputation: 1633
I'd like to see any PHP errors that are occuring, ie the "Expected ; on line 5 of myfile.php"
sort of thing. Unfortunately, I cannot seem to figure out how to see this information.
I've set E_ALL, display_errors ON, friendly error messages are turned off, IIS is set to pass-through on errors, what am I missing?
Syntax errors used to show up as stated above on any page; they no longer do. We moved the server to a localhost for development, and I guess didn't mimic exactly the server config. Now I'm stumped.
Tried on IE and Chrome, neither of which show the errors.
Errors are logged in PHP's log file, but I'd still like them to be displayed on the page; at least for now.
UPDATE:
Just tried adding ini_set('display_errors', 'on');
directly into the requested page, and it now works.. but why? Why does it need to be set locally? My PHP.ini file has this declared already.
Upvotes: 1
Views: 642
Reputation: 1633
Well, looks like this is half my own stupidity, half the cloudiness of automatic installations.
Turns out there were TWO php.ini files, and that IIS used the one located within the iis express
directory on the main drive, instead of the regular PHP
directory.
So to anybody else having this problem, I'm providing the full list of crap you have to wade through to get the errors as you would like:
1) Turn off the IIS default error pages
2) Disable 'friendly error messages'
3) Ensure you are using the CORRECT php.ini file, and change the parameters as needed. Specifically error_reporting
and display_errors
.
All of this is necessary before seeing all of the error messages you need right in the browser.
Upvotes: 0
Reputation: 783
Try using:
error_reporting (-1);
E_ALL isn't really "all" for php < 5.4.
Also, make sure 'display_errors' is set.
ini_set( 'display_errors', 1 );
Upvotes: 0
Reputation: 91792
To answer the first part of the question; to see the errors when using ajax: You can use the developer tools of your browser to see the exact response from the server.
In FireBug for Firefox for example, you go to the Net
tab and there you see all ajax request popping up as they happen. Opening one of these requests will give you an overview with more tabs like Response
and HTML
.
Upvotes: 1