PHP Warning: exec() has been disabled for security 問題解決辦法
在執行php檔案,執行exec方法時報該錯誤:
PHP Warning: system() has been disabled for security reasons in …
這是因為php7以上版本禁用了exec()函式,那麼就修改php.ini配置檔案,把這個函式從禁用的函式列中刪除:
1.檢視php.ini檔案所在目錄
php -i|grep ini
2.進入編輯php.ini檔案
vim /usr/local/php70/etc/php.ini
按i 鍵進入編輯,找到exec刪除即可,我這裡沒有截到刪除exec的前圖就.system,shell_exec也是同樣的,你在使用的時候遇到同樣的報錯也是同樣操作.
編輯完按esc鍵退出編輯,":wq"儲存並退出編輯.
3.重新啟動 php-fpm
service php-fpm restart
相關文章
- Error: php@8.0 has been disabled because it is a versioned formula! It was disabled on 2023-11-29.ErrorPHPORM
- has been blocked by CORS policy跨域問題解決BloCCORS跨域
- [git]warning: LF will be replaced by CRLF in 解決辦法Git
- Android gradle問題解決: This app has been built with an incorrect configuration. Please configure your b...AndroidGradleAPPUI
- WARNING: Logging before InitGoogleLogging() is written to STDERR 解決辦法Go
- 常見php與mysql中文亂碼問題解決辦法PHPMySql
- 跨域問題解決辦法跨域
- “command-not-found has crashed” 解決辦法 (*unsolved)
- react-解決 fetch 跨域問題:Access to fetch at XXX from origin YYY has been blocked by CORS policyReact跨域BloCCORS
- warning: LF will be replaced by CRLF in ** 的原因及解決辦法
- DedeCMS Error: Tag disabled: "php" 解決方法ErrorPHP
- svn相關問題解決辦法
- 記錄 warning: CRLF will be replaced LF by in XXX 的解決辦法
- 解決The jar file has no source attachment問題JAR
- Git:warning: CALF wilL be replaced by LF in xxxx 問題解決Git
- 解決pycharm問題:module 'pip' has no attribute 'main'PyCharmAI
- 問題解決:AttributeError: ‘NoneType‘ object has no attribute ‘append‘ErrorNoneObjectAPP
- Xshell連線Linux慢問題解決辦法Linux
- Macbook Pro Big Sur出問題解決辦法Mac
- 前端inline元素間隙問題解決辦法前端inline
- Cargo invocation has failed: Error: exit code: 101.解決辦法CargoAIError
- 【Error】AttributeError: module ‘scipy.misc‘ has no attribute ‘logsumexp‘ 的解決辦法Error
- matlab編譯exe問題具體解決辦法Matlab編譯
- springcloudconfig訪問gitee報錯:Authentication is required but no CredentialsProvider has been registeredSpringGCCloudGiteeUIIDE
- mongodb錯誤解決辦法-bash: ./mongod: cannot execute binary file: Exec format errorMongoDBORMError
- github訪問受限解決辦法Github
- php json提交亂碼的解決辦法PHPJSON
- php png失真的原因及解決辦法PHP
- PHP提示Notice: Undefined variable的解決辦法PHPUndefined
- css的position-relative相容問題與解決辦法CSS
- Authentication failure 以及xxx is not in the sudoers file 問題的解決辦法AI
- warning: CRLF will be replaced by LF in 出現的原因和解決辦法
- PyTorch出現:RuntimeError: An attempt has been made to start a new process...報錯 (已解決)PyTorchError
- RuntimeError: An attempt has been made to start a new process before the current process hasError
- wordress小程式圖片訪問出現404問題解決辦法
- 【Salesforce問題解決】Dataloader匯出的檔案亂碼或者問號的解決辦法Salesforce
- IOS下圖片不能顯示問題的解決辦法iOS
- 你遇到過的相容性問題以及解決辦法