Laravel 5.3 - Clear config cache in shared hosting

纵然是瞬间 提交于 2020-01-10 21:46:07

问题


Currently I'm working on small project that require me to host my laravel app on shared hosting (please ignore the reason why I didn't use VPS to host my laravel project) and this hosting provider disable escapeshellarg() for security reason so I can't use php artisan config:cache to clear config cache.

Is there any workaround for this?


回答1:


config:clear command just deletes bootstrap/cache/config.php file, so just delete this file manually.




回答2:


You can call artisan commands programmatically

Artisan::call('config:clear');

This can be helpful in setups where the PHP user has a different set of permissions than the FTP user (so files created by PHP cannot be deleted via FTP)




回答3:


Try also

for command line

php artisan config:cache

using artisan commands

\Artisan::call('config:clear');

https://www.tutsmake.com/laravel-clear-cache-using-artisan-command-cli/



来源:https://stackoverflow.com/questions/41521837/laravel-5-3-clear-config-cache-in-shared-hosting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!