Laravel 5.3 - Clear config cache in shared hosting

2019-02-16 16:13发布

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?

3条回答
Evening l夕情丶
2楼-- · 2019-02-16 16:26

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楼-- · 2019-02-16 16:38

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

查看更多
登录 后发表回答