【问题标题】:Error: This site can’t be reached while installing laravel 5.7 on CENT OS7错误:在 CENTOS 7 上安装 laravel 5.7 时无法访问此站点
【发布时间】:2019-05-09 17:16:48
【问题描述】:

我正在尝试配置 CENT OS 7 来部署 laravel 代码。我遵循以下方法但出现错误:

无法访问此站点,响应时间过长。以下是运行的命令。

1. yum update

PHP 安装

2. yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
3. yum install yum-utils
4. yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
5. yum-config-manager --enable remi-php72
6. yum install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json

启动服务

7. yum install httpd
8. service httpd start

安装作曲家

9. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
10. curl -sS https://getcomposer.org/installer | php72
11. mv composer.phar /usr/local/bin/composer
12. chmod +x /usr/local/bin/composer

最后在 www 文件夹中创建了一个名为 Laravel 的文件夹,并放置了所有根文件/文件夹。还放置了 folers/files 属于 html 文件夹内的 public 文件夹。

13. Restarted the services. service httpd restart

【问题讨论】:

    标签: linux centos7 laravel-5.6 laravel-5.7 linode


    【解决方案1】:

    我相信您应该将所有 Laravel 项目文件夹放在同一个文件夹中,并将根目录设置为 public 文件夹。例如,所有文件夹都应该在 html 文件夹中。

    你可能破坏了位置。

    【讨论】:

      【解决方案2】:

      你提到的错误

      无法访问此网站,响应时间过长

      是由于防火墙缺少允许连接到端口 80(如果您使用的是 https,则为 443)的说明。

      您需要运行以下命令来指示防火墙允许流量到标准 http/https 端口(如果您不打算使用 https,请不要运行第二个命令):

      sudo firewall-cmd --permanent --add-service=http
      sudo firewall-cmd --permanent --add-service=https
      sudo firewall-cmd --reload
      

      第一个和第二个命令添加规则,而第三个命令确保防火墙重新加载规则以便它知道添加的内容。


      话虽如此,您仍然需要进行更多配置才能使 Laravel 应用程序正常运行。

      【讨论】:

      • 有没有办法检查错误日志?我仍然面临同样的问题。
      猜你喜欢
      • 2023-01-26
      • 1970-01-01
      • 2021-02-04
      • 2017-12-07
      • 1970-01-01
      • 1970-01-01
      • 2014-12-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多