Per chi sviluppa con php e necessita della visualizzazione degli errori sulle proprie pagine .php, è utile attivare sul file di configurazione php.ini le opportune direttive che di default dovrebbero essere disattivate.
gheryd@gheryd-laptop:~$ cd /etc/php5/apache2/ gheryd@gheryd-laptop:/etc/php5/apache2$ ll totale 76 drwxr-xr-x 2 root root 4096 2011-05-17 12:37 ./ drwxr-xr-x 5 root root 4096 2010-10-31 10:32 ../ lrwxrwxrwx 1 root root 9 2010-05-08 20:07 conf.d -> ../conf.d/ -rw-r--r-- 1 root root 67631 2011-05-17 12:37 php.ini
o se preferite l'editor graficogheryd@gheryd-laptop:/etc/php5/apache2$ sudo nano php.ini
In evidenza le direttive con i valori da impostare.gheryd@gheryd-laptop:/etc/php5/apache2$ sudo gedit php.ini &
Ricordarsi di riavviare il server apache2:; error_reporting = E_ALL & ~E_DEPRECATED error_reporting = E_ALL & ~E_NOTICE ; This directive controls whether or not and where PHP will output errors, ; notices and warnings too. Error output is very useful during development, but ; it could be very dangerous in production environments. Depending on the code ; which is triggering the error, sensitive information could potentially leak ; out of your application such as database usernames and passwords or worse. ; It's recommended that errors be logged on production servers rather than ; having the errors sent to STDOUT. ; Possible Values: ; Off = Do not display any errors ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) ; On or stdout = Display errors to STDOUT ; Default Value: On ; Development Value: On ; Production Value: Off ; http://php.net/display-errors display_errors = On
gheryd@gheryd-laptop:/etc/php5/apache2$ sudo /etc/init.d/apache2 restart
Nessun commento:
Posta un commento