带有laravel 5的“apache虚拟主机”内部错误500“

时间:2016-02-27 14:10:05

标签: php apache amazon-ec2 laravel-5

我想学习laravel,最近通过使用apache2的作曲家composer create-project laravel/laravel laravel-app在amazon ec2实例上安装了一个新的副本laravel,并安装了php。我配置conf.d文件将文档根目录更改为laravel-folder / public,当我尝试转到公共IP地址时显示服务器500错误。

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.

    #elastic IP address
    ServerName 42.66.33.52 
    ServerAdmin webmaster@localhost
    DocumentRoot laravel-app/public

    <Directory laravel-app/public>
    DirectoryIndex index.php
    Options -Indexes +FollowSymLinks +MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted

    </Directory>

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

 我已经尝试chmod 777到整个laravel文件夹,并将app.php中的网址更改为42.66.33.52,但仍然显示相同的错误。我是laravel的新手,我希望有人可以指出我正确的方向。我没有使用laravel框架从这个服务器托管其他PHP网站,它正常运行。

2 个答案:

答案 0 :(得分:1)

您应chmod -R 775 /storage个文件夹及其中的所有文件。

答案 1 :(得分:0)

正如@Alexey Mezenin所说,您应该通过-R更改存储的chmod和所有文件,并且不要忘记对bootstrap/cache文件夹执行相同操作。检查官方laravel文档安装中的“目录权限”: https://laravel.com/docs/5.3/installation

希望有所帮助;)问候。