Php not reporting any errors on IIS7

2020-07-19 04:42发布

问题:

I am developing a PHP application using our XAMPP setup as a test server.

Once the app is ready to deploy, I have to upload it to the client's server,

The problem is the client's server is running IIS 7, and every time there is a PHP error it just displays a blank page...

Now, my app has error_reporting(E_ALL) already set, and I do not have access to the php.ini file (don't ask why!)...

and I have tried every combination of parameters for error_reporting() found here: http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting

Can anyone point me towards another way of getting the errors to show up at all?

btw: I am using codeigniter, and I've tried the error_logging functions it provides to no avail...

回答1:

It's probably good to have it turned off on a production server. You can always turn error logging on, if they'll give you access to the log file.

But for a quick fix, you can just turn display_errors on. Just remember to turn it off and set up logging when you're done getting the code configured to run on the client's server.

<?PHP
ini_set('display_errors',true);


回答2:

try

ini_set("display_errors", 1);

It's possible this is turned off.