Notice: A non well formed numeric value encountered in /home/chonable/domains/chonable.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/chonable/domains/chonable.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/chonable/domains/chonable.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/chonable/domains/chonable.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/chonable/domains/chonable.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/chonable/domains/chonable.com/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
VPS ของผู้ให้บริการบางรายจะมีการ config ค่า open_basedir เป็นการป้องกันการ include ย้อน directory ขึ้นไป (เหตุผลด้าน Security) โดยจะดักไว้ตรง public_html
ดังนั้น เมื่อเราต้องการใช้งาน framework บางตัว (เช่น Laravel) ที่ต้องมีการ include file ที่อยู่ ในเลเวล เดียวกับ public_html จะไม่สามารถทำได้
จะแจ้ง Fatal Error เป็น Fatal error: require(): Failed opening required
วิธีการแก้ไขคือ เข้าไปแก้ที่ไฟล์
1 |
/home/{USER}/conf/web/{DOMAIN}.httpd.conf |
แก้ไขตรงค่า
1 |
php_admin_value open_basedir /home/{USER}/web/{DOMAIN}/public_html:/home/{USER}/tmp |
แก้ไขเป็น
1 |
php_admin_value open_basedir /home/{USER}/web/{DOMAIN}:/home/{USER}/tmp |
นั่นก็คือ เอา public_html ออกนั่นเอง
ปล. {USER} เป็นชื่อ user account {DOMAIN} เป็นโดเมนของเว็บที่มีปัญหา
ปล2. VPS ตัวนี้ใช้ VestaCP
ปล3. คือ SSH เข้าไปก็จะเห็นเองแหละ