在此服务器上找不到请求的资源

Ann*_*lee 3 php apache cloud9-ide laravel

Laravel Framework 5.5.22c9. 我正在使用 php 版本:

$ php --version
PHP 7.0.25-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Oct 27 2017 14:07:59) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.25-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
Run Code Online (Sandbox Code Playgroud)

当我运行内置服务器的 php 时,出现错误No such file or directory

Starting PHP built-in web server, serving https://projet-laravel-testuser.c9users.io/.
PHP 7.0.25-1+ubuntu14.04.1+deb.sury.org+1 Development Server started at Thu Nov 30 17:36:08 2017
Listening on http://0.0.0.0:8080
Document root is /home/ubuntu/workspace
Press Ctrl-C to quit.
[Thu Nov 30 17:36:16 2017] 10.240.0.100:38766 [404]: / - No such file or directory
Run Code Online (Sandbox Code Playgroud)

我还测试了 apache2:

$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Sep 18 2017 16:37:54
Run Code Online (Sandbox Code Playgroud)

但是,在这里我只能blank返回一页。

任何建议我做错了什么?

我感谢您的回复!

更新

我设置:

sudo nano /etc/apache2/sites-enabled/001-cloud9.conf 并添加/public到第 2 行的末尾。

它看起来像下面这样:

<VirtualHost *:8080>
    DocumentRoot /home/ubuntu/workspace/public
Run Code Online (Sandbox Code Playgroud)

Chr*_*nce 8

当您启动内置服务器时,它看起来像是在项目根目录中运行。您可以指定一个-t标志来告诉 PHP 从不同的文件夹运行服务器:

php -S 0.0.0.0:8080 -t public/
Run Code Online (Sandbox Code Playgroud)

如果需要,请不要忘记致电php artisan key:generate并填写您的.env文件!