Home > Backend Development > PHP Tutorial > laravel5 website environment configuration and installation help

laravel5 website environment configuration and installation help

WBOY
Release: 2016-09-22 08:42:18
Original
1139 people have browsed it

laravel5框架网站安装到服务器后台界面显示,但是登录不进去,其他页面都是404,目前服务器环境:nginx/1.4.4 、mysql5.6.21、PHP5.6.22;

.env如下:

<code>APP_ENV=local
APP_DEBUG=true
APP_KEY=Wknod8gk0jUUTTSz3QgbgwgVBmN9afA3

DB_HOST=127.0.0.1
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=*****

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
</code>
Copy after login

.htaccess如下:

<code><IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

</code>
Copy after login

nginx.conf:

<code>server {
        listen       80;
        server_name  ***.com;
    index index.html index.htm index.php;
    root /alidata/www/test/public;
    
      try_files $uri $uri/ @rewrite;  
    location @rewrite {  
        rewrite ^/(.*)$ /index.php?_url=/$1;  
    }  
    location ~ .*\.(php|php5)?$
    {
        #fastcgi_pass  unix:/tmp/php-cgi.sock;
        fastcgi_pass  127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires 30d;
    }
    location ~ .*\.(js|css)?$
    {
        expires 1h;
    }

    include /alidata/server/nginx/conf/rewrite/test.conf;
    access_log  /alidata/log/nginx/access/test.log;
    if (-f $request_filename/index.html){
    rewrite (.*) $1/index.html break;
    }
    if (-f $request_filename/index.php){
    rewrite (.*) $1/index.php;
    }
    if (!-f $request_filename){
    rewrite (.*) /index.php;
    }
}  
</code>
Copy after login

求大神帮忙看看那里没对,O(∩_∩)O谢谢

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template