php 使用 exce不執行與 報錯

2022-09-21 16:36:12 字數 1415 閱讀 8818

"

fatal error: uncaught think\\exception\\errorexception: error_log(\/www\/wwwroot\/test.limiaokeji.cn\/runtime\/log\/202202\/16_cli.log): failed to open stream: permission denied in \/www\/wwwroot\/test.limiaokeji.cn\/thinkphp\/library\/think\/log\/driver\/file.php:169",

"stack trace:",

"",

"#1 \/www\/wwwroot\/test.limiaokeji.cn\/thinkphp\/library\/think\/log\/driver\/file.php(169): error_log('[ 2022-02-16t17...', 3, '\/www\/wwwroot\/te...')",

"#2 \/www\/wwwroot\/test.limiaokeji.cn\/thinkphp\/library\/think\/log\/driver\/file.php(75): think\\log\\driver\\file->write('[ 2022-02-16t17...', '\/www\/wwwroot\/te...', false, true)",

"#3 \/www\/wwwroot\/test.limiaokeji.cn\/thinkphp\/library\/think\/log.php(179): think\\log\\driver\\file->s**e(array, true)",

"#4 \/www\/wwwroot\/test.limiaokeji.cn\/thinkphp\/library\/think\/error.php(93): think\\log::s**e()",

"",

"#6 ",

"thrown in \/www\/wwwroot\/test.limiaokeji.cn\/thinkphp\/library\/think\/log\/driver\/file.php on line 169

"

問題原因:

runtime目錄沒有給到777許可權,日誌寫入失敗導致的報錯。

解決辦法:

給目錄專案的runtime目錄777許可權即可 

不執行:

出於安全的原因,伺服器是不允許php或者其他語言執行exec命令的,當你有特殊需要php在伺服器執行exec命令時,你需要設定兩個地方,不然就無法執行成功。

修改php.ini

找到php配置檔案php.ini,

在檔案裡搜尋「disable_functions」,找到它後把「exec」、「shell_exec」去掉,然後儲存檔案。

PHP編譯,執行make報錯

編譯安裝php 的時候,執行make報錯誤 make ext phar phar.php 錯誤 127 root localhost php 5.4.9 mkdir usr local webserver mysql include mysql root localhost php 5.4.9 ln...

PHP編譯,執行make報錯

編譯安裝php 的時候,執行make報錯誤 make ext phar phar.php 錯誤 127 root localhost php 5.4.9 mkdir usr local webserver mysql include mysql root localhost php 5.4.9 ln...

PHP編譯,執行make報錯

編譯安裝php 的時候,執行make報錯誤 make ext phar phar.php 錯誤 127 root localhost php 5.4.9 mkdir usr local webserver mysql include mysql root localhost php 5.4.9 ln...