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条)

报告相同问题?

悬赏问题

  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划