3

I have a PHP application deployed on my IIS hosting and I am always getting generic IIS "error 500" pages insteady of detailed error pages.

I understand I need to modify some php.ini file (from this question).

It seems that display_errors is set correctly:

echo ini_get('display_errors');

outputs 1.

I have also tried setting display_errors and error_reporting in the function that causes the error (I know the particular function is the problem because I manually modified it).

function sendEmail( $aForm, $sFile = 'messages.tpl', $sTargetEmail = null ){ 
  error_reporting(E_ALL);
  ini_set('display_errors', 'On');
  //rest of the function

EDIT: I know I should have set these values in some php.ini file - how can I specify php.ini values on a shared hosting, when I have only access to my app folder via FTP?

How can I identify the error details?

Community
  • 1
  • 1
Marek
  • 10,307
  • 8
  • 70
  • 106
  • Is the _actual_ error being logged in the servers error log? (I worked on a server before where I just couldn't get the appropriate errors to be displayed - sometimes the output would just be _blank_! However, the error log reported it correctly - just a pain to have to keeping checking it!) – MrWhite Jul 17 '10 at 16:53
  • Presumably you do have error_reporting(E_ALL) enabled? Do you get no errors at all reported correctly? Or is it just related to your sendMail() script? As far as mail() is concerned there are some major differences between IIS and Apache in this respect which could be responsible? – MrWhite Jul 17 '10 at 17:03

1 Answers1

1

It looks to me like you do have 'display_errors' turned on but your hosting provider is redirecting your 500 error page to a custom page which doesn't display the errors. Not a great set up but I would contact your hosting provider in the hope that they can shed some light on the problem. It is possible to have .user.ini files on IIS see see http://learn.iis.net/page.aspx/745/enable-per-site-php-configuration-on-iis-60-and-iis-7-and-above/ again only your hosting provider would know if this is set up.

Dan-Dev
  • 8,957
  • 3
  • 38
  • 55