How to configure PHP to display detailed errors instead of a 500 error page?

I have a PHP application deployed on my IIS hosting and I always get sample pages with an IIS error of 500 error instead of detailed error pages.

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

It seems that display_errors is set correctly:

echo ini_get('display_errors');

displays 1.

I also tried setting display_errors and error_reporting in a function that causes an error (I know that a particular function is a problem because I manually changed 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 had to set these values ​​in some php.ini file - how can I specify php.ini values ​​on shared hosting when I only have access to my application folder via FTP?

?

+3
1
+1

Source: https://habr.com/ru/post/1755115/


All Articles