Mac builds the laravel environment, uses the nginx server, modifies the blade template, and refreshes the page without responding

Source: Internet
Author: User
Nginx + php + laravel has been set up on mac, without too many configurations. Instead, configure the nginx root path to the public directory of laravel, and set listening to port 80, the google font on the laravelwelcome page has been removed, not a google issue. If I use phparti... nginx + php + laravel has been set up on mac, without too many configurations. Instead, configure the nginx root path to the public directory of laravel, and set listening to port 80, the google font on the laravel welcome page has been removed, not a google issue.

If I use php artisan serve to use the laravel built-in server, I can normally access the laravel default welcome page (http: // localhost: 8000) and modify views/welcome. blade. php, refreshing the page is also normal.

Use nginx to access port 80: Access normal php files (http: // localhost/a. php), for example, create a. php file under public, and access and print phpinfo files. But the access (http: // localhost) cannot be accessed, and the page is blank. The link is through the nginx server.

PS: If I access the built-in Port 8000 first, I can access port 80. However, I cannot directly access port 80 after modifying the template file.

Where is the configuration problem or other problems?

Laravel versions: 5.2
Php version: 7.0.2

Resolved: I have changed the permissions of laravel/storage and laravel/bootstrap/cache.
sudo chmod -R 777 laravel/storage
sudo chmod -R 777 laravel/bootstrap/cache
But I still don't know why this problem won't happen when I use php artisan serve.

Reply content:

Nginx + php + laravel has been set up on mac, without too many configurations. Instead, configure the nginx root path to the public directory of laravel, and set listening to port 80, the google font on the laravel welcome page has been removed, not a google issue.

If I use php artisan serve to use the laravel built-in server, I can normally access the laravel default welcome page (http: // localhost: 8000) and modify views/welcome. blade. php, refreshing the page is also normal.

Use nginx to access port 80: Access normal php files (http: // localhost/a. php), for example, create a. php file under public, and access and print phpinfo files. But the access (http: // localhost) cannot be accessed, and the page is blank. The link is through the nginx server.

PS: If I access the built-in Port 8000 first, I can access port 80. However, I cannot directly access port 80 after modifying the template file.

Where is the configuration problem or other problems?

Laravel versions: 5.2
Php version: 7.0.2

Resolved: I have changed the permissions of laravel/storage and laravel/bootstrap/cache.
sudo chmod -R 777 laravel/storage
sudo chmod -R 777 laravel/bootstrap/cache
But I still don't know why this problem won't happen when I use php artisan serve.

When you use php artisan serve, php is called by the user, so no permission is insufficient.
During nginx running, the account may not have the write permission for the project file. You need to check which user is configured in the nginx configuration file and change the account to which the storage belongs.

In the local environment, open the php. ini error prompt and run it to see what went wrong. I guess it should be the cause of the low php version in your mac environment. Try php5.6.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.