在我看来,500 内部错误即将到来,因为您尚未在 apache httpd.conf 文件中设置虚拟主机。
将此行放在 httpd.conf 文件中
对于窗户
NameVirtualHost *:80
<VirtualHost *:80>
ServerName yourlaravel.com
DocumentRoot "C:/wamp/www/laravel/public"
<Directory "C:/wamp/www/laravel/public">
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "C:/wamp/www"
<Directory "C:/wamp/www">
</Directory>
</VirtualHost>
对于 Linux
NameVirtualHost *:80
<VirtualHost *:80>
ServerName yourlaravel.com
DocumentRoot "/var/www/laravel/public"
<Directory "/var/www/laravel/public">
</Directory>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/var/www"
<Directory "/var/www">
</Directory>
</VirtualHost>
并在您的本地机器上运行它
对于窗口打开 C:\Windows\System32\drivers\etc\hosts 放这一行。
yourserverip yourlaravel.com
对于 linux 打开 \etc\hosts 放置这一行。
yourserverip yourlaravel.com
您可以参考此链接了解更多信息:
http://net.tutsplus.com/tutorials/php/building-web-applications-from-scratch-with-laravel/
我希望这能有所帮助。