简体   繁体   English

在Centos服务器上设置laravel 5

[英]Setting up laravel 5 on Centos server

I am trying setup a Centos Server with LAMP installed in it. 我正在尝试安装安装了LAMP的Centos服务器。

I have a laravel project created successfully but still when i am opening a route (/) its showing 500 ERROR i don't know where did the configuration goes wrong. 我已经成功创建了一个laravel项目,但是当我打开路线(/)时仍显示500错误,我不知道配置在哪里出错。

Here is how my htaccess file looks like: 这是我的htaccess文件的样子:

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

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

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

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

And here is how my /etc/httpd/conf/httpd.conf file looks like: 这是我的/etc/httpd/conf/httpd.conf文件的样子:

DocumentRoot "/var/www/html"

#
# Relax access to content within /var/www.
#
<Directory "/var/www">
    AllowOverride none
    # Allow open access:
    Require all granted
</Directory>

# Further relax access to the default document root:
<Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride none

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>

I have installed all the required plugins as well. 我还安装了所有必需的插件。

I installed wordpress and it seems to be running smoothly. 我安装了wordpress,它似乎运行顺利。 But i am not sure why its not working with this. 但是我不确定为什么它不起作用。

Here is my project URL http://104.199.222.145/demo2/ i just did a basic laravel installation. 这是我的项目URL http://104.199.222.145/demo2/我只是做了基本的laravel安装。

I am thinking this as a more .htaccess problem somewhere. 我认为这是一个更多的.htaccess问题。 But not sure. 但不确定。

Thank you! 谢谢!

Did you set up the permissions to the laravel folders ? 您是否设置了对laravel文件夹的权限?

sudo chmod 755 -R demo2
chmod -R o+w demo2/storage

What's the laravel version that you installed on your server? 您在服务器上安装的laravel版本是什么? And what's your server php version? 以及您的服务器php版本是什么? If the requirements are not met laravel throws 500 errors. 如果不满足要求,laravel会抛出500个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM