7 คำตอบ
ตั้งแต่มีการติดตั้ง Rights Ext. มีปัญหาเลย
- อันแรกคือ เข้าใช้ gii ไม่ได้ เนื่องจาก Ip fileter (แก้ไขแล้ว)
- พอเข้าหน้า gii ได้ และ ลอง generate models ดู ปรากฎว่า ได้ข้อความข้างล่างนี้ขี้นมา สาเหตุเกิดจากอะไรครับ
Error 500
file_put_contents(/home/rdkkc/public_html/protected/runtime/gii-1.1.16/ModelCode.php): failed to open stream: Permission denied
เกี่ยวกับ Permission ครับ ลบไฟล์ทั้งหมดใน runtime จากนั้น chmod runtime เป็น 777 ครับ
ลบ ข้อมูลทั้งหมดใน runtime แล้วครับสามารถgen models ได้ครับ แต่พอมาทำ crud ได้ error นี้มาครับ
------------------------------------------------------------------------------------------------------------------
There was some error when generating the code. Please check the following messages.
------------------------------------------------------------------------------------------------------------------
Generating code using template "/home/rdkkc/public_html/framework/gii/generators/crud/templates/default"... generating controllers/JournalController.php
Unable to write the file '/home/rdkkc/public_html/protected/controllers/JournalController.php'. generating views/journal/_form.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. generating views/journal/_search.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. generating views/journal/_view.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. generating views/journal/admin.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. generating views/journal/create.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. generating views/journal/index.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. generating views/journal/update.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. generating views/journal/view.php
Unable to create the directory '/home/rdkkc/public_html/protected/views/journal'. done!
Generating code using template "/home/rdkkc/public_html/framework/gii/generators/crud/templates/default"...
เนื่องจากเป็น linux ดังนั้นไฟล์ที่จะสร้างใน folder ผ่าน script จะต้อง chmod folder ให้เป็น 777 ครับ เช่น
controllers และ views ครับ
จริงๆ แล้วควรทำใน localhost ก่อนนำขึ้น server นะครับ
ขอบคุณครับอาจารย์ พอดีว่าต้องใช้ก่อนครับสุดวิสัยจริงครับ เลยต้องมานั่งแก้ไขและเพิ่มเติมในภายหลัง