【问题标题】:Laravel does not appear when browsing VPS's IP浏览 VPS 的 IP 时没有出现 Laravel
【发布时间】:2014-04-10 22:36:20
【问题描述】:

我刚刚按照本教程在我的 ubuntu vps 上安装了带有 nginx 的 Laravel 4: https://www.digitalocean.com/community/articles/how-to-install-laravel-with-nginx-on-an-ubuntu-12-04-lts-vps

Evertything 似乎安装得很好,但是当浏览它的 ip 地址时,我仍然得到:

有效!

这是此服务器的默认网页。 Web 服务器软件正在运行,但尚未添加任何内容。

我认为这可能与虚拟主机有关,但似乎也配置正确

server {
    listen   80 default_server;

    root /var/www/laravel/public/;
    index index.php index.html index.htm;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    # pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
    location ~ \.php$ {
            try_files $uri /index.php =404;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
    }
}

会有人知道我做错了什么吗? 谢谢!

【问题讨论】:

    标签: php nginx laravel


    【解决方案1】:

    您的网络服务器应该指向 /public 文件夹,而不是您的 laravel 应用程序的根目录。

    那是/var/www/laravel/public 不是/var/www/laravel/

    还要确保重新启动服务器以加载配置文件。

    【讨论】:

    • 我已经在我的服务器上编辑了那个错误,对不起,我会编辑帖子
    • 你重启你的服务器了吗?屏幕上的错误是什么?
    • 我做了,没有显示错误,只是显示了www/目录下的index.html文件
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-03
    • 2017-10-22
    • 1970-01-01
    • 1970-01-01
    • 2016-08-17
    相关资源
    最近更新 更多