Laravel with error in no composer install

0

I moved the laravel to the ratification server and when I rolled the composer install, I had this problem. Has anyone ever had anything like this? on my machine that runs under the vagrant smooth wheel.

The environment is laravel 5.4, redhat 7 and php 7

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
PHP Warning:  Uncaught ErrorException: require(/var/www/html/gemeos-backend/vendor/rachidlaasri/laravel-installer/src/Providers/../routes/web.php): failed to open stream: No such file or directory in /var/www/html/gemeos-backend/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:71
Stack trace:
#0 /var/www/html/gemeos-backend/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(71): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'require(/var/ww...', '/var/www/html/g...', 71, Array)
#1 /var/www/html/gemeos-backend/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php(71): require()
#2 /var/www/html/gemeos-backend/vendor/rachidlaasri/laravel-installer/src/Providers/LaravelInstallerServiceProvider.php(27): Illuminate\Support\ServiceProvider->loadRoutesFrom('/var/www/html/g...')
#3 /var/www/html/gemeos-backend/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(574): RachidLaasri\LaravelInstaller\Providers\LaravelInstallerServiceProvider->register( in /var/www/html/gemeos-backend/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php on line 71
PHP Fatal error:  Illuminate\Support\ServiceProvider::loadRoutesFrom(): Failed opening required '/var/www/html/gemeos-backend/vendor/rachidlaasri/laravel-installer/src/Providers/../routes/web.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/gemeos-backend/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php on line 71


  [Symfony\Component\Debug\Exception\FatalErrorException]
  Illuminate\Support\ServiceProvider::loadRoutesFrom(): Failed opening requir
  ed '/var/www/html/gemeos-backend/vendor/rachidlaasri/laravel-installer/src/
  Providers/../routes/web.php' (include_path='.:/usr/share/pear:/usr/share/ph
  p')


Script php artisan optimize handling the post-install-cmd event returned with error code 255
    
asked by anonymous 12.09.2017 / 20:00

1 answer

1

There are two ways to install Laravel, the first and perhaps most common one to install the "laravel / installer", first run the command in any folder, it does not have to be where you will create the project:

composer global require "laravel/installer"

This will install "globally", so the installer will allow you to use, of course the composer needs to be installed globally as well, so you have to add $HOME/.composer/vendor/bin to $PATH of the operating system.

After making sure everything is global, run Navigate to the Apache folder and try to create a new project:

cd /var/www/html
laravel new gemeos-backend2

See if the problem still occurs.

The alternative way, without the command laravel is to install via create-project of the composer, navigate to the folder and run the command:

cd /var/www/html
composer create-project --prefer-dist laravel/laravel gemeos-backend3

Solving potential problems

By error message:

  Uncaught ErrorException: require (/ var / www / html / gemeos-backend / vendor / rachidlaasri / laravel-installer / src / Providers / ../ routes / web.php): failed to open stream: No such file or directory in /var/www/html/gemeos-backend/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:71

I assume that something has been downloaded in the wrong version or mixed, we must first ensure that everything is up to date, to update the composer run the command:

composer self-update

If it is not global, run:

php composer.phar self-update

If you are using Laravel / Installer then remove it first:

composer global remove laravel/installer

And then try installing it again and creating a project:

composer global require "laravel/installer"
cd /var/www/html
laravel new gemeos-backend4
  

Note: I changed the folder name ( gemeos-backend2 , gemeos-backend3 and gemeos-backend4 ) for each test done,      

Note laravel/installer will install the 5.5 version of Laravel

    
12.09.2017 / 21:44