Nerede hata konsolu?

3 Cevap php

Ben PHP yeniyim, Kod Ateşleyici ve MAMP ile başladı. Ben MAMP uygulamadan sunucusunu başlatmak ve metin editörü PHP,.

Hataları kodunda meydana geldiğinde, sayfa bir şey göstermek değil! Konsolda hataları görmek için yine de var mı? veya PHP sadece hataları göstermek değil mi?

Java geliştirirken ben konsolu Tutulmalar alışkınım, benzer bir şey var mı?

3 Cevap

Error Reporting


In your code add :

 error_reporting(E_ALL);
 // I don't know if you need to wrap the 1 inside of double quotes.
 ini_set("display_startup_errors",1);
 ini_set("display_errors",1);

ya da php.ini dosyasında yapabilirsiniz.

http://php.net/manual/en/errorfunc.configuration.php


Java geliştirirken ben konsolu Tutulmalar alışkınım, benzer bir şey var mı?

Eclipse, hem de Eclipse PHP IDE - Evet, var Zend Studio.

ZS - http://www.zend.com/en/products/studio/

Eclipse - http://www.eclipse.org/downloads/

The errors should be displayed, looks like a supression issue which the others have covered. Something to look into is the application/config/config.php file that contains run-time configuration for the CodeIgniter framework:

(Satır sayısını 166 başlangıç ​​:)

166 |    0 = Disables logging, Error logging TURNED OFF
167 |    1 = Error Messages (including PHP errors)
168 |    2 = Debug Messages
169 |    3 = Informational Messages
170 |    4 = All Messages
171 |
172 | For a live site you'll usually only enable Errors (1) to be logged otherwise
173 | your log files will fill up very fast.
174 |
175 */
176 $config['log_threshold'] = 4;

Bu, tüm hataları atar, onlar Codeigniter günlükleri klasörüne gösterilmez bile (yüklü sürümünde bu konumu için belgelerine bakın.)

Yardımcı umuyoruz!

Orada Tutulma konsoluna benzer birçok süslü yolu vardır, ancak sadece 2 everythere çalışır.

First of all you have to decide, where you want to see your errors - online or in the log file. Usually we set online for developers machine and log for the public server. Unix-way for log is often used - tail -f /path/error_log

To set bullet-proof settings use either php config or apache config. So, to display errors online,
set display_errors = on in the php.ini file (be sure you edit working one)
or set php_value display_errors = 1 in the httpd.conf/.htaccess

Üzerinde kamu sunucu için ben genellikle içine şu satırları ekleyin hosting .htaccess:

php_value display_errors = 0
php_value log_errors = 1
php_value error_log = "/path/to/log.file" #if I want to have it separate from webserver's error log

Seviyesini Raporlama hep aynı kalır ve yapılandırma php dosyası ile ayarlanır

 error_reporting(E_ALL);