วันพุธที่ 18 กันยายน พ.ศ. 2556

การใช้งานแบบ Globals ยังไม่ปลอดภัย

การใช้งานแบบ Globals ยังไม่ปลอดภัย
ล้มเหลว
SECURITY WARNING!
To operate properly, Moodle requires
that you make certain changes to your current PHP settings.
You must set
register_globals=off
.
This setting is controlled by editing your
php.ini
, Apache/IIS 
configuration or
.htaccess
file
แก้ยังไงครับ เพิ่งหัดใช้ครับ


วิธีแก้
เปิด C:\Windows\php.iniด้วยnotepadแล้วหาบรรทัด register_globals=on ให้แก้เป็น register_globals=off แล้วsaveแล้วrestart windows

Server จริง

สร้างไฟล์ .htaccess ขึ้นมา และให้เขียนข้อความลงในไฟล์ดังนี้คือ 
php_value register_globals 0
จากนั้นให้อัพโหลดไฟล์ .htaccess ลงในไดเรกทอรี่ htdocs เพียงเท่านี้ท่านก็ได้ทำการปิด Register Global ให้เป็น Off เรียบร้อยแล้ว