簡體   English   中英

500內部服務器錯誤Laravel 4

[英]500 Internal Server Error Laravel 4

我在Laravel 4中有項目。它在bitbucket上。 我已經從本地計算機上的存儲庫中下載了該文件,並創建了本地虛擬主機,並且工作正常。 但是,當我在服務器上克隆相同的項目並創建虛擬主機時,會顯示500 Internal Server Error。 在同一域上,laravel 5中同一項目的另一個虛擬主機運行正常。

這是我的laravel 4項目的虛擬主機文件代碼:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName l4.mydomain
    ServerAlias l4.mydomain

    DocumentRoot /var/www/L4/public

    <Directory /var/www/L4/public/>
            AllowOverride All
    </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
    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
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

這是laravel 4項目的.htaccess代碼:

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

  RewriteEngine On

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

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

我也將'index.php'更改為644權限,但是沒有用

這是在日志文件中發現的警告和錯誤:

PHP Warning:  require(/var/www/myproject/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/L4/bootstrap/autoload.php on line 17


PHP Fatal error:  require(): Failed opening required '/var/www/myproject/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/L4/bootstrap/autoload.php on line 17

如果你得到

"PHP Fatal error: require(): Failed opening required '/var/www/L4/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/L4/bootstrap/autoload.php on line 17"錯誤日志中的"PHP Fatal error: require(): Failed opening required '/var/www/L4/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/L4/bootstrap/autoload.php on line 17"我想好像您從未在服務器上運行過composer安裝。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM