CI框架中遇見的一些錯誤和解決方法 筆記,ci框架
ps:根據經驗不斷修改和更新,歡迎指出錯誤~
1、
An uncaught Exception was encountered
Type: Exception
Message: Session: Configured save path '/usr/share/nginx/html/terminal_php/application/../sesssion_files' is not writable by the PHP process.
Filename: /usr/share/nginx/html/terminal_php/system/libraries/Session/drivers/Session_files_driver.php
A PHP Error was encountered
Severity: Warning
Message: fopen(1f194f2bef7c1013a926c931c860a0eb62071b84): failed to open stream: Permission denied
Filename: drivers/Session_files_driver.php
原因: 訪問Session_files_driver.php該文件的權限不夠,因為sesssion_files該文件夾內是儲存session的文件,然而每次用戶訪問都會進行動態生成session的寫入、讀取和執行,因此,只要設置好“讀、寫、執行”權限即可。
解決辦法:提高權限(chmod 777)
2、
Warning: mkdir(): Permission denied in /usr/share/nginx/html/terminal_php/system/core/Log.php on line 122
A PHP Error was encountered
Severity: Warning
Message: mkdir(): Permission denied
Filename: core/Log.php
Line Number: 122
Backtrace:
File: /usr/share/nginx/html/terminal_php/index.php
Line: 293
Function: require_once
原因:由於服務器(nginx或者apache或者其他服務器)賬戶沒有權限創建文件,因為必須把修改網站根目錄的權限
解決辦法:提高服務器賬戶的權限(chmod)