dongyi7901 2018-05-09 21:29
浏览 874
已采纳

Laravel不会在面板中读取.env文件

I've uploaded my Laravel app to a cpanel host . The problem is that Laravel does not read the contents of the .env file and show me a "Whoops, looks like something went wrong." page ( twice In one page ) This error is displayed because the program can not receive the APP_KEY variable . can not read .env file at all . I searched a little for this problem, but the solutions did not work . I tried all these:

  • 'php artisan cache:clear' command
  • 'php artisan config:clear' command
  • 'php artisan config:cache' command
  • change permission for .env file (755)
  • run all 'composer update' , 'composer install' , 'composer dump-autoload' commands
  • I did not use env function anywhere
  • There are no spaces in the values stored in the env file

But none of the above did not work out. However, My program runs well in local ( windows ) and there is no problem But it does not run on the server ( cpanel )

note : I realized that when I execute the 'php artisan config:cache' command on server , all cache files are made in 'bootstrap/cache' folder, except for the config.php file note2 : I uploaded several times in different ways. Once all the files in the folder in the root and the public files in the public_html folder . and once all the files in the public_html folder. Both not working

Does anyone know where the problem is?

in this time i put all my app files in public_html folder

  • 写回答

3条回答 默认 最新

  • doudui1850 2018-05-13 17:59
    关注

    Take a look at the storage/logs/laravel.log file to get more accurate information.

    Make sure the putenv() and getenv() functions are not disabled In php.ini

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名