Mac build Laravel environment, use Nginx server, modify blade template and Refresh page without reaction

Source: Internet
Author: User
Tags phpinfo nginx server
Set up the Nginx+php+laravel on the Mac, did not do too much configuration, just the Nginx root path is configured under the public laravel, and then sets the listening is 80 port, Laravel Google fonts on the Welcome page have been removed, not Google.

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

Using Nginx Access 80 port: Access to normal PHP file normal (http://localhost/a.php) For example, create a a.php under public, you can access the print phpinfo and so on. But the access (http://localhost) cannot access, the page shows blank, this link is through Nginx server.

PS: If I first access the built-in 8000 port, I can access 80 port, but I changed the template file directly to access 80 port is not.

Excuse me, where is this configuration problem or other problem?

Laravel Version: 5.2
PHP Version: 7.0.2

已解决: I changed the authority of Laravel/storage and Laravel/bootstrap/cache to a little bit.
sudo chmod -R 777 laravel/storage
sudo chmod -R 777 laravel/bootstrap/cache
However, it is still unclear why PHP artisan serve is not the case.

Reply content:

Set up the Nginx+php+laravel on the Mac, did not do too much configuration, just the Nginx root path is configured under the public laravel, and then sets the listening is 80 port, Laravel Google fonts on the Welcome page have been removed, not Google.

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

Using Nginx Access 80 port: Access to normal PHP file normal (http://localhost/a.php) For example, create a a.php under public, you can access the print phpinfo and so on. But the access (http://localhost) cannot access, the page shows blank, this link is through Nginx server.

PS: If I first access the built-in 8000 port, I can access 80 port, but I changed the template file directly to access 80 port is not.

Excuse me, where is this configuration problem or other problem?

Laravel Version: 5.2
PHP Version: 7.0.2

已解决: I changed the authority of Laravel/storage and Laravel/bootstrap/cache to a little bit.
sudo chmod -R 777 laravel/storage
sudo chmod -R 777 laravel/bootstrap/cache
However, it is still unclear why PHP artisan serve is not the case.

PHP Artisan serve when you call the user PHP, so there is no lack of permission situation.
and Nginx run time account may not have the project file write permission, this to see the Nginx configuration file is configured in the user is which, the storage account to change to that the line

Local environment put php.ini error prompt open, run to see where the problem, I guess it should be your Mac environment PHP version low reason, change php5.6 try.

  • Related Article

    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.