Vasim Shaikh
Vasim Shaikh

Reputation: 4512

Laravel Project is not working Lampp & Ubuntu 16.04

I have install a laravel in a htdocs folder using following command. When I have start a project using artisan it not start.please review a things.

​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

Updated After Applied solution

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

enter image description here

Upvotes: 1

Views: 1195

Answers (4)

the_lorem_ipsum_guy
the_lorem_ipsum_guy

Reputation: 474

You are missing ext-dom, php7.1-xml has the packages you need, try installing it by running:

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

Then run this command:

composer install

If you don't have a composer you can follow this link from Digital Ocean which is very clear.

You can also refer their tutorial which is How To Deploy a Laravel Application with Nginx on Ubuntu 16.04.

Upvotes: 0

Adlan Arif Zakaria
Adlan Arif Zakaria

Reputation: 1745

Install the following dependency:

sudo apt-get install php7.1-xml

You can try refer the issues here: PHP7 : install ext-dom issue

Upvotes: 2

Hayden Sweet
Hayden Sweet

Reputation: 170

You are missing the correct extension for PHP try installing

sudo apt-get install php7.1-dom

You may also need to install other packages to get everything to update.

Take a look at this link may help you https://askubuntu.com/questions/795629/install-php-extensions-in-ubuntu-16-04

Upvotes: 1

lucasvscn
lucasvscn

Reputation: 1230

Your screenshot says: "phpunit required ext-dom" ..

That means, you have to install PHP-XML extension in order to get phpunit and Laravel properly installed.

Upvotes: 1

Related Questions