During the installation of my project, I had to install and update my composer. However I can't do it beacause composer tells me this :
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache
Warning: require_once(C:\Projects\private\p1\../app/bootstrap.php.cache): failed to open stream: No such file or directory in C:\Projects\private\p1\bin\console on line 11
Fatal error: require_once(): Failed opening required 'C:\Projects\private\p1\bin/../app/bootstrap.php.cache' (include_path='.;C:\php\pear') in C:\Projects\private\p1\bin\console on line 11
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command:
Warning: require_once(C:\Projects\private\p1\bin/../app/bootstrap.php.cache): failed to open stream
: No such file or directory in C:\Projects\private\p1\bin\console on line 11
Fatal error: require_once(): Failed opening required 'C:\Projects\private\p1\bin/../app/bootstrap.php.cache' (include_path='.;C:\php\pear') in C:\Projects\private\p1\bin\console on line 11
I've been searching an answer for 2 days and I've tried everything I coulded see on the internet...
I don't know if you need something else but please help me
If the bootstrap.php.cache file was not created for different reasons. Normally it should be generated after running composer install in your project directory.
If you need to generate it manually, just run the following command in your Symfony project folder:
php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php
If you have the new Symfony 3 folder structure you need to add three arguments:
php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php var app new
The file will then be generate in var/bootstrap.php.cache instead of app/bootstrap.php.cache.
Steps to solve your problem :
run this command : bin/console cache:clear --env=prod
run this chown www-data:www-data projectDirectory
run this command SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
run this command chown www-data:www-data projectDirectory
Related
I'm setting up my Laravel environment, having installed composer and laravel. I can't call php artisan
I've tried installing and updating, however I'm still being returned errors.
C:\Users\Pat\personal> php artisan PHP Warning:
require(C:\Users\Pat\personal/vendor/autoload.php): failed to open
stream: No such file or directory in C:\Users\Pat\personal\artisan on
line 18
Warning: require(C:\Users\Pat\personal/vendor/autoload.php): failed to
open stream: No such file or directory in
C:\Users\Pat\personal\artisan on line 18 PHP Fatal error: require():
Failed opening required 'C:\Users\Pat\personal/vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in C:\Users\Pat\personal\artisan on
line 18
Fatal error: require(): Failed opening required
'C:\Users\Pat\personal/vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in C:\Users\Pat\personal\artisan on
line 18 PS C:\Users\Pat\personal>
the vendor folder is missing so you got this error:
Warning: require(C:\Users\Pat\personal/vendor/autoload.php): failed to
open stream: No such file or directory in
C:\Users\Pat\personal\artisan on line 18
Run this command in your command prompt:
composer update --no-scripts
composer update
composer update --no-scripts It will Skips execution of scripts defined in composer.json file.
composer update It will update your depencencies as they are specified in composer.json file.
With this command, you will re-create the vendor folder in your project
Type on CLI:
composer install
run this command first
composer dump-autoload
source and credits to: require(vendor/autoload.php): failed to open stream on Synchro comment
Check there might not vendor folder in your project root. So first run composer install command in the terminal. And it will generate the file that are missing.
Yesterday I updated my windows from version 1803 to 1903. Today I tried to continue work on my laravel application and tried to run PHP artisan serve for development.
What I got was an error message:
PHP Warning: require(C:\Users\MY_USERNAME\MY_PROJECT/vendor/autoload.php): failed to open stream: No such file or directory in artisan on line 18
Warning: require(C:\Users\MY_USERNAME\MY_PROJECT/vendor/autoload.php): failed to open stream: No such file or directory in artisan on line 18
PHP Fatal error: require(): Failed opening required 'C:\Users\MY_USERNAME\MY_PROJECT/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in artisan on line 18
Fatal error: require(): Failed opening required 'C:\Users\MY_USERNAME\MY_PROJECT/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in artisan on line 18
But those files exist. I did not change anything after updating to windows 1903.
Its because you haven't installed Composer dependencies so
Cd To your project and run composer install in your terminal
I had this same problem because of the Windows update and I couldn't do composer install in my original project because it didnt find the composer.json, so... I pushed it on Github, downloaded and then made composer install on the new project and it works. Maybe it's not the best solution... but worked for me
I am new to laravel, and while installing laravel using composer I am seeing an error. I tried finding the solution, but end up finding nothing. I also tried composer update. But still face issue while installing, below is the command.
COMMAND:
composer create-project --prefer-dist laravel/laravel cms 5.2
ERROR:
Fatal error: require(): Failed opening required
'C:\xampp\htdocs\cms\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\cms\bootstrap\autoload.php on line 17
PHP Warning: require(C:\xampp\htdocs\cms\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\cms\bootstrap\autoload.php on line 17
PHP Fatal error: require(): Failed opening required
'C:\xampp\htdocs\cms\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\cms\bootstrap\autoload.php on line 17
Script php artisan clear-compiled handling the pre-update-cmd event returned
with error code 255
I have tried reinstalling composer and still the problem arise. Thanks in advance
Try this:
composer create-project --prefer-dist laravel/laravel cms "5.2.*"
Note* If you already have a cms directory, delete it first before you run the above command.
Read more: https://laravel.com/docs/5.2/installation#installing-laravel
Run composer dump-autoload will solve this error.
Would you please help me to find out my installation problem of Laravel. I installed composer then installed laravel. When i try to run the project through php artisan serve, it gives following error.
Warning: require(/opt/lampp/htdocs/laravel_project/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/laravel_project/bootstrap/autoload.php on line 17
Fatal error: require(): Failed opening required '/opt/lampp/htdocs/laravel_project/bootstrap/../vendor/autoload.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/laravel_project/bootstrap/autoload.php on line 17
I mention some things that the installed laravel folder contains totalling 120 items and total size 651kb. inside the projct directory, there is no folder named vendor. i'm using ubuntu 16.
If vendor folder is present in your directory, try this command. It may help you.
cp .env.example .env
php artisan key:generate
As per #Gravy mentions in the comments, you need to run composer install in order to generate the autoload.php file.
I am absolutly new in Composer and in Laravel framework.
I am trying to create a new Laravel 5.2 project using Composer to download it performing this statment in the GIT Bash shell:
composer create-project laravel/laravel cms 5.2
But I am obtaining the following error message:
$ composer create-project laravel/laravel cms 5.2
Installing laravel/laravel (v5.2.0)
- Installing laravel/laravel (v5.2.0) Downloading: 100%
Created project in cms
> php -r "copy('.env.example', '.env');"
> php artisan clear-compiled
Warning: require(C:\xampp\htdocs\cms\bootstrap/../vendor/autoload.php): failed t
o open stream: No such file or directory in C:\xampp\htdocs\cms\bootstrap\autolo
ad.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\cms\bootstrap/.
./vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\cms
\bootstrap\autoload.php on line 17
PHP Warning: require(C:\xampp\htdocs\cms\bootstrap/../vendor/autoload.php): fai
led to open stream: No such file or directory in C:\xampp\htdocs\cms\bootstrap\a
utoload.php on line 17
PHP Fatal error: require(): Failed opening required 'C:\xampp\htdocs\cms\bootst
rap/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdoc
s\cms\bootstrap\autoload.php on line 17
Script php artisan clear-compiled handling the pre-update-cmd event returned wit
h error code 255
Why? What could be the problem? Something related Windows folder permission or what?
How can I try to fix this issue?
It appears composer is trying to flush the compiled files which aren't created yet.
Step 1) Install Laravel without scripts
composer create-project --no-scripts laravel/laravel cms 5.2
Step 2) Run post install scripts manually.
cd cms
composer run-script post-install-cmd
you are having problem because your version value is not complete. you also have to put subversion or asteric(*) symbol
you have to use following command for achieve what you want
composer create-project laravel/laravel cms 5.2.*