1

After installing Composer it worked well, Laravel created all folders and it started correctly with:

php artisan serve

Now, when I try:

laravel new mypro

It does not create the vendor folder. And when I try:

php artisan serve

It says:

php artisan serve
PHP Warning:  require(/mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/autoload.php on line 17
PHP Fatal error:  require(): Failed opening required '/mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog4/bootstrap/autoload.php on line 17

After I copy folder vendor it says:

php artisan serve
PHP Fatal error:  Class 'Illuminate\Notifications\NotificationServiceProvider' not found in /mnt/PROJECTS/[3]_PROCOM/[6]_PHP_Learning/Laravel_1/blog3/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146


  [Symfony\Component\Debug\Exception\FatalErrorException]                 
  Class 'Illuminate\Notifications\NotificationServiceProvider' not found  
Peter Hall
  • 53,120
  • 14
  • 139
  • 204
Luisa Manticora
  • 11
  • 1
  • 1
  • 3

4 Answers4

3

I encountered the same problem. It occurred because the composer was not able to install the dependencies specified in composer.json file. try running

composer install 

If this does not solve the problem, make sure the following PHP modules are installed php-mbstring php-dom

To install this extensions run the following in terminal

sudo apt-get install php-mbstring php-dom

once the installation is complete

try running the command again in your project root folder

composer install 

So, if the above doesn't work, you can as well try this command

composer update --no-scripts 

More solutions on this thread. Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

samtax01
  • 834
  • 9
  • 11
2

Instead of copying vendor folder please run a command

composer install

in your laravel's project directory

Manvir Singh
  • 431
  • 4
  • 6
  • Made it, nothing changed, it told: composer install Cannot create cache directory /home/satori/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/satori/.composer/cache/files/, or directory is not writable. Proceeding without cache – Luisa Manticora Feb 06 '17 at 12:34
  • Cannot create cache directory /home/satori/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Your requirements could not be resolved to an installable set of packages. – Luisa Manticora Feb 06 '17 at 12:35
  • Problem 1 - Installation request for laravel/framework v5.4.6 -> satisfiable by laravel/framework[v5.4.6]. – Luisa Manticora Feb 06 '17 at 12:36
  • - laravel/framework v5.4.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. – Luisa Manticora Feb 06 '17 at 12:36
  • Problem 2 - Installation request for phpunit/phpunit 5.7.9 -> satisfiable by phpunit/phpunit[5.7.9]. - phpunit/phpunit 5.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system. – Luisa Manticora Feb 06 '17 at 12:36
  • your directory is not writeable you don't have permission to write in it – Manvir Singh Feb 06 '17 at 12:36
  • Problem 3 - laravel/framework v5.4.6 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. - laravel/tinker v1.0.0 requires illuminate/console ~5.1 -> satisfiable by laravel/framework[v5.4.6]. - Installation request for laravel/tinker v1.0.0 -> satisfiable by laravel/tinker[v1.0.0]. – Luisa Manticora Feb 06 '17 at 12:36
  • To enable extensions, verify that they are enabled in your .ini files: - /etc/php/5.6/cli/php.ini - /etc/php/5.6/cli/conf.d/10-opcache.ini - /etc/php/5.6/cli/conf.d/10-pdo.ini – Luisa Manticora Feb 06 '17 at 12:36
  • - /etc/php/5.6/cli/conf.d/20-calendar.ini - /etc/php/5.6/cli/conf.d/20-ctype.ini - /etc/php/5.6/cli/conf.d/20-exif.ini - /etc/php/5.6/cli/conf.d/20-fileinfo.ini - /etc/php/5.6/cli/conf.d/20-ftp.ini - /etc/php/5.6/cli/conf.d/20-gettext.ini - /etc/php/5.6/cli/conf.d/20-iconv.ini - /etc/php/5.6/cli/conf.d/20-json.ini – Luisa Manticora Feb 06 '17 at 12:36
  • - /etc/php/5.6/cli/conf.d/20-phar.ini - /etc/php/5.6/cli/conf.d/20-posix.ini - /etc/php/5.6/cli/conf.d/20-readline.ini - /etc/php/5.6/cli/conf.d/20-shmop.ini - /etc/php/5.6/cli/conf.d/20-sockets.ini - /etc/php/5.6/cli/conf.d/20-sysvmsg.ini - /etc/php/5.6/cli/conf.d/20-sysvsem.ini - /etc/php/5.6/cli/conf.d/20-sysvshm.ini - /etc/php/5.6/cli/conf.d/20-tokenizer.ini - /etc/php/5.6/cli/conf.d/20-zip.ini You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode. – Luisa Manticora Feb 06 '17 at 12:37
0

After trying multiple solutions from different sources, the only thing that worked for me was upgrading the PHP version.

Peter Hall
  • 53,120
  • 14
  • 139
  • 204
IrfanAnwar
  • 79
  • 1
  • 10
-1

Try to install it manually sudo apt-get install php5.6-mbstring

Onix
  • 2,129
  • 2
  • 17
  • 26
  • Made it, now it says: Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for phpunit/phpunit 5.7.9 -> satisfiable by phpunit/phpunit[5.7.9]. - phpunit/phpunit 5.7.9 requires ext-dom * -> the requested PHP extension dom is missing from your system. – Luisa Manticora Feb 06 '17 at 13:52
  • try this now `sudo apt-get install php-xml` – Onix Feb 06 '17 at 14:29
  • Reading package lists... Done Building dependency tree Reading state information... Done php-xml is already the newest version. The following package was automatically installed and is no longer required: libvpx1:i386 Use 'apt-get autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. – Luisa Manticora Feb 06 '17 at 16:34