I've set up a fresh install of Ubuntu Server 12.04 LTS on Amazon AWS with *Apache2/MySQL/PHP5. When I run a PHP script and it encounters an error I don't see any error reporting from PHP, all I see is
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request.
I have checked my /etc/php5/apache2/php.ini
file and as far as I can tell error reporting should be set up. The contents of the file (regarding errors) are:
; display_errors
; Default Value: On
; Development Value: On
; Production Value: Off
; display_startup_errors
; Default Value: Off
; Development Value: On
; Production Value: Off
; error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
Can anyone advise? If I try something like $obj = new ObjectDoesntExist;
it doesn't tell me Fatal error: Class 'ObjectDoesntExist'
it gives me a server 500 error.
Any advise?
* The modules I have installed are: mysql-server mysql-client apache2 php5 libapache2-mod-php5 phpmyadmin
. Other than that it is a completely base install of Ubuntu Server 12.04 LTS
EDIT:
If I use ini_set('display_errors', '1');
at the start of my script it displays errors as normal, but how do I enable this site wide?
<? phpinfo(); ?>
give output? – Endbrain/var/log/apache2/error.log
? – Doyledoyleydisplay_errors
is declared and turn it on. – Imagine<?phpinfo(); ?>
gives output as expected. Apache error log shows the PHP errors I was expecting (unexpected T_STRING / Failed opening required files) amongst other things I recognise (Apache restarts). – Eponymdisplay_errors
anddisplay_startup_errors
and changed their values fromOff
toOn
but still the same issue? Do I have to uncomment the lines above them that read the same as the commented lines I originally posted? – Eponym