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
相關文章
- has been blocked by CORS policy跨域問題解決BloCCORS跨域
- Error: php@8.0 has been disabled because it is a versioned formula! It was disabled on 2023-11-29.ErrorPHPORM
- Starting sendmial: make: Warning: File 'virtusertable.db' has ..的解決辦法2
- 這個問題如何解決?Cannot forward after response has been committedForwardMIT
- [git]warning: LF will be replaced by CRLF in 解決辦法Git
- git warning: LF will be replaced by CRLF in 解決辦法Git
- 跨域問題解決辦法跨域
- 常見php與mysql中文亂碼問題解決辦法PHPMySql
- svn相關問題解決辦法
- TSM 5.4 ANR0110E An unexpected system date has been detected 問題的解決
- Hadoop出現 native snappy library not available: SnappyCompressor has not been loaded的解決辦法HadoopAPPAI
- DedeCMS Error: Tag disabled: "php" 解決方法ErrorPHP
- WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED解決方法REMIDE
- warning: LF will be replaced by CRLF in ** 的原因及解決辦法
- 【Ubuntu】unknown host問題解決辦法Ubuntu
- HTC Vive遇到的問題解決辦法
- 虛擬化問題及解決辦法
- veritas netbackup的問題解決辦法
- oracle壞塊問題及解決辦法Oracle
- 解決The jar file has no source attachment問題JAR
- spring security 問題解決方案Spring
- This function has none of DETEMINISTIC,NO SQL錯誤解決辦法FunctionNoneSQL
- Myeclipse 錯誤An internal error has occurred 解決辦法EclipseError
- ORA-28001: the password has expired解決辦法
- java.lang.IllegalStateException: getOutputStream() has already been called for this response解決方案JavaException
- nginx部署後常見問題解決辦法Nginx
- jive 漢字問題終極解決辦法
- 遠端桌面不能全屏問題解決辦法
- oracle rac asm 問題的官方解決辦法OracleASM
- REMOTE HOST IDENTIFICATION HAS CHANGED 問題解決REMIDE
- “command-not-found has crashed” 解決辦法 (*unsolved)
- Macbook Pro Big Sur出問題解決辦法Mac
- Vmware vSphere常見問題及解決辦法
- getOutputStream() has already been called
- 解決pycharm問題:module 'pip' has no attribute 'main'PyCharmAI
- MySQL server has gone away 問題的解決方法MySqlServerGo
- Android gradle問題解決: This app has been built with an incorrect configuration. Please configure your b...AndroidGradleAPPUI
- react-解決 fetch 跨域問題:Access to fetch at XXX from origin YYY has been blocked by CORS policyReact跨域BloCCORS