Skip to content


การสร้าง PHP Error Log

วันนี้ได้ทำการจัดการเรื่อง error ของ php ไม่ให้แสดงบนหน้าเวป แต่ไปเก็บไว้ที่ file แทน ทำให้เพิ่มความปลอดภัยของเวปไซต์เราและยังสามารถทำการ debug โปรแกรมได้ง่ายด้วย

จาก WikiBall



ปิดไม่ให้แสดง error

# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off


แสดง error ใน logs file

# enable PHP error logging
php_flag  log_errors on
php_value error_log  /home/path/public_html/domain/PHP_errors.log


จัดการ permission ของ logs

# prevent access to PHP error log
<Files PHP_errors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

รับข้อมูลจาก (Reference) :

จาก WikiBall : http://wiki.memoball.info/index.php/การสร้าง_PHP_Error_logs_ใน_.htaccess

Posted in Linux, PHP. Tagged with .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.