Home>

The site created with laravel is connected to EC2 with teratarm, and apache is used for production.

When clearing the cache while resolving the error,
I want to try to fix it because the screen is blank and nothing is displayed.

Error message

When I was trying to solve other errors, I was referring to the article below.
Upload images to AWS S3 with Laravel

Because I tried to clear the cache locally, which led to the resolution.
The same thing was done in the production environment, and php artisan config: clear was done
No screen display at all.

[Access log]

218.140.51.131--[19/Nov/2019: 12: 15: 05 +0900] "GET /css/news.css HTTP/1.1" 404 1552 "********* **** ap-northeast-1.compute.amazonaws.com/news/create "" Mozilla/5.0 (Windows NT 10.0;Win64;x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36 "
218.140.51.131--[19/Nov/2019: 12: 15: 13 +0900] "POST/news/create HTTP/1.1" 500 614159 "http: //********.ap-northeast- 1.compute.amazonaws.com/news/create "" Mozilla/5.0 (Windows NT 10.0;Win64;x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36 "
218.140.51.131--[19/Nov/2019: 12: 39: 33 +0900] "POST/news/create HTTP/1.1" 500 614164 "http: // ******** ap-northeast-1 .compute.amazonaws.com/news/create "" Mozilla/5.0 (Windows NT 10.0;Win64;x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36 "
218.140.51.131--[19/Nov/2019: 12: 39: 37 +0900] "GET /favicon.ico HTTP/1.1" 200-"http: //***********.ap -northeast-1.compute.amazonaws.com/news/create "" Mozilla/5.0 (Windows NT 10.0;Win64;x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36 "
206.189.145.214--[19/Nov/2019: 12: 42: 03 +0900] "GET/HTTP/1.0" 200 8617 "-" "masscan/1.0 (https://github.com/robertdavidgraham/masscan)"
103.83.5.41--[19/Nov/2019: 13: 04: 06 +0900] "GET/HTTP/1.0" 200 8617 "-" "masscan/1.0 (https://github.com/robertdavidgraham/masscan)"
218.140.51.131--[19/Nov/2019: 13: 49: 14 +0900] "GET/HTTP/1.1" 200 8642 "-" "Mozilla/5.0 (iPhone;CPU iPhone OS 12_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.2 Mobile/15E148 Safari/604.1 "
218.140.51.131--[19/Nov/2019: 13: 49: 14 +0900] "GET /apple-touch-icon-120x120-precomposed.png HTTP/1.1" 404 1552 "-" "MobileSafari/604.1 CFNetwork/978.0 .7 Darwin/18.7.0 "
218.140.51.131--[19/Nov/2019: 13: 49: 15 +0900] "GET /apple-touch-icon-120x120.png HTTP/1.1" 404 1552 "-" "MobileSafari/604.1 CFNetwork/978.0.7 Darwin/18.7.0 "
218.140.51.131--[19/Nov/2019: 13: 49: 15 +0900] "GET /apple-touch-icon-precomposed.png HTTP/1.1" 404 1552 "-" "MobileSafari/604.1 CFNetwork/978.0.7 Darwin/18.7.0 "

[Error log]

Failed to parse dotenv file due to an invalid name.Failed at [cd/var/www/html/MyPortfolioAPP_NAME].
The environment file is invalid!
Failed to parse dotenv file due to an invalid name.Failed at [cd/var/www/html/MyPortfolioAPP_NAME].
The environment file is invalid!
Failed to parse dotenv file due to an invalid name.Failed at [cd/var/www/html/MyPortfolioAPP_NAME].
[Tue Nov 19 14: 14: 12.242678 2019] [mpm_prefork: notice] [pid 6921] AH00170: caught SIGWINCH, shutting down gracefully
[Tue Nov 19 14: 14: 13.409228 2019] [suexec: notice] [pid 32264] AH01232: suEXEC mechanism enabled (wrapper:/usr/sbin/suexec)
[Tue Nov 19 14: 14: 13.432313 2019] [lbmethod_heartbeat: notice] [pid 32264] AH02282: No slotmem from mod_heartmonitor

-EC2 instance restart
・ Restart apache

I researched various things, but when I put it up to the production environment, I made a frustration based on the reference article,
I didn't know the content honestly, so I couldn't find a solution.

I would appreciate any advice.

Supplemental information (FW/tool version etc.)

Laravel 6.2.0
PHP 7.2.19
cloud 9 (local environment)
ec2 (production environment)
teratarm 4.104
Apache 2.4.39

  • Answer # 1

    Typically, there is no permission to write the template file and autoload is wrong
    If you are running through apache, is there anything written in the output log specified by apache?

    After that, how to reflect
    If you use git, there will be no basic problems
    Even if you are using rsync, it will be no problem if you set the exclusion file properly or set it so that the permission is not overwritten.
    If you don't take them into account with FTP or SFTP client tools, directory permissions and autoload files may be messed up

    If you know it, try recreating autoload withphp artisan dump-autoload

Related articles