php - laravel public related issues
習慣沉默
習慣沉默 2017-06-12 09:20:08
0
4
645

I have installed laravel once before, and I can open the welcome page by directly accessing public under laravel.
This time I copied one from someone else, and after accessing public, the files under public are directly displayed, as shown below. What's going on? (Newbie, please explain in detail, thank you very much)

習慣沉默
習慣沉默

reply all(4)
巴扎黑

In case of nginx configuration problem, in your case, you should check whether your nginx server module index has index.php, and then check whether nginx is configured with php-fpm to process PHP files

曾经蜡笔没有小新

Detailed reference:


Pretty URLs

Apache

The framework ships with a public/.htaccess file that is used to allow URLs without index.php. If you use Apache to serve your Laravel application, be sure to enable the mod_rewrite module.

If the .htaccess file that ships with Laravel does not work with your Apache installation, try this one:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

https://laravel.com/docs/5.1

女神的闺蜜爱上我

First, check whether you are accessing through the HTTP protocol. This situation usually occurs when accessing through the file: protocol.

曾经蜡笔没有小新

Thank you for your answers. It is indeed a problem on the server side. Gundy's answer is Nginx's processing method. Mine is an apache server. The following paragraph is the result of Baidu.
Under the Apache directory, there is a conf directory. Open the "httpd" in it. .conf" file, find the DirectoryIndex section. Change it to DirectoryIndex index.php index.Html index.html In this way, the default homepage of your website directory is index.php. If there is no index.php, the system will automatically look for index.html , html is used as the default homepage.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template