Laravel 项目不工作 Lampp & Ubuntu 16.04

Laravel Project is not working Lampp & Ubuntu 16.04

我已经使用以下命令在 htdocs 文件夹中安装了 laravel。当我使用 artisan 开始一个项目时,它没有 start.please 回顾事情。

​sevenbits11@SBT-PC-11:/opt/lampp/htdocs$ sudo composer create-project laravel/laravel first-project --prefer-dist
sevenbits11@SBT-PC-11:/opt/lampp/htdocs/first-project$ php artisan serve
PHP Warning:  require(/opt/lampp/htdocs/first-project/vendor/autoload.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/first-project/artisan on line 18
PHP Fatal error:  require(): Failed opening required '/opt/lampp/htdocs/first-project/vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/lampp/htdocs/first-project/artisan on line 18

应用解决方案后更新

sudo php artisan serve
PHP Warning:  require(/opt/lampp/htdocs/first-project/vendor/autoload.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/first-project/artisan on line 18
PHP Fatal error:  require(): Failed opening required '/opt/lampp/htdocs/first-project/vendor/autoload.php' (include_path='.:/usr/share/php') in /opt/lampp/htdocs/first-project/artisan on line 18

您的屏幕截图显示:"phpunit required ext-dom" ..

这意味着,您必须安装 PHP-XML 扩展才能正确安装 phpunit 和 Laravel。

您缺少 PHP 的正确扩展,请尝试安装

sudo apt-get install php7.1-dom

您可能还需要安装其他软件包才能更新所有内容。

看看这个link可能对你有帮助https://askubuntu.com/questions/795629/install-php-extensions-in-ubuntu-16-04

安装以下依赖项:

sudo apt-get install php7.1-xml

您可以尝试参考这里的问题:

您缺少 ext-domphp7.1-xml 有您需要的软件包,尝试通过 运行ning 安装它:

sudo apt-get update
sudo apt-get install php7.1-xml

然后运行这个命令:

composer install

如果您没有作曲家,您可以按照 Digital Ocean 中的这个 link 进行操作,非常清楚。

你也可以参考他们的教程How To Deploy a Laravel Application with Nginx on Ubuntu 16.04