且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法获得Laravel欢迎页面显示

更新时间:2023-09-25 23:20:58

php -S localhost:8888 -t public用于在本地运行网站,这就是视频所显示的内容.

如果要在Ubuntu和Apache上使用Digital Ocean Droplet,则需要将Apache配置为使用/public作为文档根目录,并在/var/www目录中安装Laravel.

从那里您可以访问Droplet的IP地址(http://XXX.XXX.XXX.XXX)而不是域名(除非您已为该域名配置了DNS).您也不需要URL中的端口,因为Apache将在默认端口80上提供该端口.

My server is on DigitalOcean cloud. I am using Ubuntu with Apache web server. My home computer is running Windows 7. I am using putty for terminal.

Followed all of the directions on https://laracasts.com/series/laravel-5-fundamentals/episodes/1. Made it up to 8:40, where it directs you to run php -S localhost:8888 -t public. I run that, then open a web browser and tried the following:

-http://mywebsite.com:8888
-http://www.mywebsite.com:8888
-http://mywebsite.com/learning-laravel-5/public
-http://mywebsite.com/learning-laravel-5/public/index.php

None of the above work.

In Google Chrome, the first two options where I list the port number, I get a page saying This webpage is not available. ERR_CONNECTION_REFUSED. In IE, I just get a page with big font saying "This page can't be displayed."

For the last two options, I just get a completely blank page. In the console, I get this error: Failed to load resource: the server responded with a status of 500 (Internal Server Error).

I'm trying to pick up a web app framework to broaden my php skill set. Can someone help me out? What am I doing wrong/what is the video tutorial missing that I have to do in order to get Laravel up and running?

php -S localhost:8888 -t public is meant for running a site locally, which is what the video is showing.

If you are using a Digital Ocean droplet with Ubuntu and Apache, you will need to configure Apache to use /public as the document root and have Laravel installed in the /var/www directory.

From there you can visit the droplet's IP address (http://XXX.XXX.XXX.XXX) instead of the domain name (unless you have configured the DNS for that domain name). You won't need the port in the URL either, since Apache will be serving it on the default port 80.

推荐文章