Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP 7 return 500 server error. Not reporting any errors

Tags:

php

iis

php-7

PHP 7 does not return any errors only server error 500. I set error reporting to development machine but error file/screen is still empty. For example:

echo 'test'; output is test but ech 'test'; (incorect) returns server error 500 i have tried already:

ini_set('display_errors',true);

and

ini_set('error_reporting', E_ALL);

but nothing happens.

IIS8
PHP7
like image 587
Klapsius Avatar asked Feb 25 '26 19:02

Klapsius


1 Answers

I had the exact same issue too, upgrading from the IIS supported 5.x to 7.0.9. Here's the trick. By default the php.ini in 7.x does not have logging enabled:

1) Create a blank file with write permissions from IIS (IUSR in Windows 10)

2) Edit your php.ini and remove the semicolon ';' and update the error_log variable:

; Log errors to specified file. PHP's default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
error_log = C:\path\to\file\errors.log
; Log errors to syslog (Event Log on Windows).
;error_log = syslog

3) Restart IIS service using IIS manager

like image 117
Andrew Buettner Avatar answered Feb 27 '26 10:02

Andrew Buettner