require(vendor/autoload.php): failed to open stream - php

I know that this issue has been posted many times, but for me it seems to be a different problem.
Indeed, this error
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\site_web\send_mail.php on line 3
Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\site_web\send_mail.php on line 3
appears at the begining of my code from this line:
require 'vendor/autoload.php';
So, I guess there must be a /vendor/autoload.php file somewhere in my computer (I have installed composer and ran composer require phpmailer/phpmailer).
So, I looked for this file using: dir /s autoload.php in the Windows command line, and found one here: C:\Windows\SysWOW64\vendor\autoload.php,
but for me, syswow64 folder has nothing to see with autoload.php, I don't see what I am missing here.

What you're missing is running composer install, which will import your packages and create the vendor folder, along with the autoload script.
Make sure your relative path is correct. For example the example scripts in PHPMailer are in examples/, below the project root, so the correct relative path to load the composer autoloader from there would be ../vendor/autoload.php.
The autoload.php you found in C:\Windows\SysWOW64\vendor\autoload.php is probably a global composer installation – where you'll usually put things like phpcs, phpunit, phpmd etc.
composer update is not the same thing, and probably not what you want to use. If your code is tested with your current package versions then running update may cause breakages which may require further work and testing, so don't run update unless you have a specific reason to and understand exactly what it means. To clarify further – you should probably only ever run composer update locally, never on your server as it is reasonably likely to break apps in production.
I often see complaints that people can't use composer because they can't run it on their server (e.g. because it's shared and they have no shell access). In that case, you can still use composer: run it locally (an environment that has no such restrictions), and upload the local vendor folder it generates along with all your other PHP scripts.
Running composer update also performs a composer install, and if you do not currently have a vendor folder (normal if you have a fresh checkout of a project), then it will create one, and also overwrite any composer.lock file you already have, updating package versions tagged in it, and this is what is potentially dangerous.
Similarly, if you do not currently have a composer.lock file (e.g. if it was not committed to the project), then composer install also effectively performs a composer update. It's thus vital to understand the difference between the two as they are definitely not interchangeable.
It is also possible to update a single package by naming it, for example:
composer update ramsey/uuid
This will re-resolve the version specified in your composer.json and install it in your vendor folder, and update your composer.lock file to match. This is far less likely to cause problems than a general composer update if you just need a specific update to one package.
It is normal for libraries to not include a composer.lock file of their own; it's up to apps to fix versions, not the libraries they use. As a result, library developers are expected to maintain compatibility with a wider range of host environments than app developers need to. For example, a library might be compatible with Laravel 5, 6, 7, and 8, but an app using it might require Laravel 8 for other reasons.
Composer 2.0 removed any remaining inconsistencies between install and update results; if you're running composer 1.x you should definitely upgrade.

If you get the error also when you run
composer install
Just run this command first
composer dump-autoload
This command will clean up all compiled files and their paths.

#Bashir almost helped me but I needed:
composer update --no-scripts
Apparently this prevents any scripts from being included before executing artisan.
I found the answer here half-way down the page:
https://laracasts.com/discuss/channels/general-discussion/fatal-error-class-illuminatefoundationapplication-not-found-in-pathtoprojectbootstrapappphp-on-line-14?page=0

Proper autoload.php configuration:
A) Quick answer:
Your autoload.php path is wrong. ie. C:\Windows\SysWOW64\vendor\autoload.php
To date: you need to change it to: C:\Users\<Windows User Name>\vendor\autoload.php
B) Steps with example:
We will take facebook/php-graph-sdk as an example; change to Package Name as needed.
Install composer.exe
Open CMD Prompt. + R + type CMD
Run This command: composer require facebook/graph-sdk
Include path in your PHP page: require_once 'C:\Users\<Windows User Name>\vendor\autoload.php';
Define configuration Secrets and Access Token for your package...etc.
Happy codinig.
C) Further details:
Installing composer on windows will set this default path for your pacakges; you can find them there and include the autoloader path:
C:\Users\<Windows User Name>\vendor
For the same question you asked; the answer was this path for WAMP Server 64 BIT for Windows.
Then simply in your PHP Application change this:
require_once __DIR__ . '/vendor/autoload.php';
To:
require_once 'C:\Users\<Windows User Name>\vendor\autoload.php';
Find your windows username under C:\Users\
Before all this, as pointed before in B) , you need to run this command:
composer require <package name>
for facebook php SDK for example:
composer require facebook/graph-sdk
Thank you for asking this question; appreciated as it helped me fix similar issue and ended writing this simple tutorial.

First make sure you have installed the composer.
composer install
If you already have installed then update the composer.
composer update

If you have cloned your project from Github or got it from somewhere else, you will encounter this error. That's because you are missing the vendor folder and other files. The vendor folder contains packages which are dependent to your project. The package dependencies are stored in composer.json file and the folder was excluded while pushing to Github.
Fix this error by simply running:
composer install
Then you will get all the assets needed for your project.

First, review route inside index.php
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
in my case the route did not work, I had to review the directories.

For me
Just run this command first
composer dump-autoload
to add vendor folder.
then run this command
composer update --no-scripts
to update composer.

Create composer.json file with requisite library for ex:
{
"require": {
"mpdf/mpdf": "^6.1"
}
}
Execute the below command where composer.json exists:
composer install
In case of Drupal :
Use the web root folder of drupal to include autoload for ex:
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/vendor/autoload.php';
In case of other systems:
Use the root folder variable or location to include the autoload.php

I had this path in my machine:
C:/xampp5.0/htdocs/project-recordando-symfony/project-recordando-symfony
Then I ran composer install or/and composer update and it returned this error:
ErrorException ZipArchive::extractTo...
That error is because your path is too much long, I changed to:
C:/xampp5.0/htdocs/p-symfony/*
and worked!

run composer update. That's it

I was able to resolve by removing composer and reinstalling the proper way. Here is what I did:
sudo apt remove composer
sudo apt autoclean && sudo apt autoremove
Installed globally with the instructions from: https://getcomposer.org/doc/00-intro.md
Download from: https://getcomposer.org/installer
global install: mv composer.phar /usr/local/bin/composer
(Note: I had to move mine to mv composer.phar /usr/bin/composer)
I was then able to get composer install to work again. Found my answer at the bottom of this issue: https://github.com/composer/composer/issues/5510

In your project folder, the vendor folder is missing so you got this error:
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in
When you download the project through git, the project is downloaded without the vendor folder
You need /vendor because all your packages are there, including all the classes Laravel uses. The vendor directory contains your Composer dependencies.
The solution is simple, Just run this command:
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 and after that your project will start working normally.

This error occurs because of missing some files and the main reason is "Composer"
First Run these commands in CMD
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Then
Create a New project
Example:
D:/Laravel_Projects/New_Project
laravel new New_Project
After that start the server using
php artisan serve

In my case, It was due to the non-fully installation of the project, because I didn't have enough space on my hard disk

There will be a directory called "vendor" that needs to be in your root directory if you have a cloned repository and trying to set up that time this type of error occurring.
".gitingore" file has written code to not include vendor directory on GIT so after cloning GIT your project facing the issue of missing vendor directory.
Once you add vendor directory your project will start working again.

Change the auto_prepend_file property on php.ini
; Automatically add files before PHP document.
;http://php.net/auto-prepend-file
auto_prepend_file =

In linux first add github Personal access tokens
Navigate to GitHub's Personal Access Tokens page.
Hit "Generate new token" button.
Type something meaningful "Note", select "repo" as scope and hit "Generate token" button.
Take a note of the token.
5 type in terminal with you new "personal access token"
export COMPOSER_AUTH='{"github-oauth":{"github.com":"AB8cd4cab23a9d5399934a7d7698d3fa74e9cfAB"}}'
Run in terminal composer install

Related

Running commands after Composer package installed globally

I have created a Composer package which is designed to be installed globally, it's basically a package to spin up Docker environments for projects that I use a lot for local development. I'd like to share my package but would like to make it more user friendly.
Currently when the package is installed (with composer global require me/my-package-name), the user needs to take some extra steps:
cd into the install location and run composer install (inside the root of my package in their vendor dir)
On MacOS, users also need to run cd docker && chmod +x phpenv
Add above docker folder to their PATH
I'm trying to make this less of a pain, so I attempted to add a post package install command - composer.json:
"scripts": {
"post-package-install": [
"DannyXCII\\Environment\\Install\\Installer::postPackageInstall"
]
},
public static function postPackageInstall(): void
{
$path = dirname(__DIR__, 3);
exec("cd $path && composer install && composer update && composer dump-autoload && cd docker && chmod +x phpenv");
}
After trying and failing to get this to work when installing this globally I realise now that this script won't get called when this package is installed, only when packages are required and composer install is ran inside this package, as:
Note: Only scripts defined in the root package's composer.json are executed. If a dependency of the root package specifies its own scripts, Composer does not execute those additional scripts.
So, I believe in this case, the solution would be to add this script to the root project - so I'd need to update this script and add to the composer.json file in C:\Users\Danny\AppData\Roaming\Composer(?), as would anyone else wanting to use this - so this doesn't solve my issues regarding usability.
I have been searching and attempting to resolve this for a while but found this quite a difficult topic to search on.
Essentially, my question is: how can I run commands such as composer install inside my package after it is globally required without the user having to do so manually?
Ok so I've now solved this - so, you know how you can run composer global require laravel/installer and immediately type laravel and you'll see some help text from the command? This is the same level of convenience I wanted to achieve with my package so I decided where better to look to see how it's done?
I was thinking about this incorrectly; I don't want a vendor directory inside my globally installed package and I shouldn't ever expect commands like composer install inside my package.
I was able to remove the two blocks from above. Inside my phpenv script, where I'm looking for the autoloader from within my package, I also added an additional check, so that this will use the autoloader at C:/Users/Danny/AppData/Roaming/Composer/vendor/autoload.php if it exists - this removes the need to run composer install (one step down):
if (file_exists(dirname(__DIR__, 3) . '/autoload.php')) {
require dirname(__DIR__, 3) . '/autoload.php';
} else {
require dirname(__DIR__, 1) . '/vendor/autoload.php';
}
Assuming you have your Composer bin directory added to your path (something like C:/Users/Danny/AppData/Roaming/Composer/bin), I was able to remove the need to add the path to this package specifically by making sure that the script to execute my commands was mapped to the above bin directory. I moved my phpenv script to a bin directory in my package and then added the following to my composer.json - this removes the need to add the path to the script directory to my environment variables path:
"bin": [
"bin/phpenv"
],

Email verification on registration using php Mailer not working [duplicate]

I know that this issue has been posted many times, but for me it seems to be a different problem.
Indeed, this error
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\site_web\send_mail.php on line 3
Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\site_web\send_mail.php on line 3
appears at the begining of my code from this line:
require 'vendor/autoload.php';
So, I guess there must be a /vendor/autoload.php file somewhere in my computer (I have installed composer and ran composer require phpmailer/phpmailer).
So, I looked for this file using: dir /s autoload.php in the Windows command line, and found one here: C:\Windows\SysWOW64\vendor\autoload.php,
but for me, syswow64 folder has nothing to see with autoload.php, I don't see what I am missing here.
What you're missing is running composer install, which will import your packages and create the vendor folder, along with the autoload script.
Make sure your relative path is correct. For example the example scripts in PHPMailer are in examples/, below the project root, so the correct relative path to load the composer autoloader from there would be ../vendor/autoload.php.
The autoload.php you found in C:\Windows\SysWOW64\vendor\autoload.php is probably a global composer installation – where you'll usually put things like phpcs, phpunit, phpmd etc.
composer update is not the same thing, and probably not what you want to use. If your code is tested with your current package versions then running update may cause breakages which may require further work and testing, so don't run update unless you have a specific reason to and understand exactly what it means. To clarify further – you should probably only ever run composer update locally, never on your server as it is reasonably likely to break apps in production.
I often see complaints that people can't use composer because they can't run it on their server (e.g. because it's shared and they have no shell access). In that case, you can still use composer: run it locally (an environment that has no such restrictions), and upload the local vendor folder it generates along with all your other PHP scripts.
Running composer update also performs a composer install, and if you do not currently have a vendor folder (normal if you have a fresh checkout of a project), then it will create one, and also overwrite any composer.lock file you already have, updating package versions tagged in it, and this is what is potentially dangerous.
Similarly, if you do not currently have a composer.lock file (e.g. if it was not committed to the project), then composer install also effectively performs a composer update. It's thus vital to understand the difference between the two as they are definitely not interchangeable.
It is also possible to update a single package by naming it, for example:
composer update ramsey/uuid
This will re-resolve the version specified in your composer.json and install it in your vendor folder, and update your composer.lock file to match. This is far less likely to cause problems than a general composer update if you just need a specific update to one package.
It is normal for libraries to not include a composer.lock file of their own; it's up to apps to fix versions, not the libraries they use. As a result, library developers are expected to maintain compatibility with a wider range of host environments than app developers need to. For example, a library might be compatible with Laravel 5, 6, 7, and 8, but an app using it might require Laravel 8 for other reasons.
Composer 2.0 removed any remaining inconsistencies between install and update results; if you're running composer 1.x you should definitely upgrade.
If you get the error also when you run
composer install
Just run this command first
composer dump-autoload
This command will clean up all compiled files and their paths.
#Bashir almost helped me but I needed:
composer update --no-scripts
Apparently this prevents any scripts from being included before executing artisan.
I found the answer here half-way down the page:
https://laracasts.com/discuss/channels/general-discussion/fatal-error-class-illuminatefoundationapplication-not-found-in-pathtoprojectbootstrapappphp-on-line-14?page=0
Proper autoload.php configuration:
A) Quick answer:
Your autoload.php path is wrong. ie. C:\Windows\SysWOW64\vendor\autoload.php
To date: you need to change it to: C:\Users\<Windows User Name>\vendor\autoload.php
B) Steps with example:
We will take facebook/php-graph-sdk as an example; change to Package Name as needed.
Install composer.exe
Open CMD Prompt. + R + type CMD
Run This command: composer require facebook/graph-sdk
Include path in your PHP page: require_once 'C:\Users\<Windows User Name>\vendor\autoload.php';
Define configuration Secrets and Access Token for your package...etc.
Happy codinig.
C) Further details:
Installing composer on windows will set this default path for your pacakges; you can find them there and include the autoloader path:
C:\Users\<Windows User Name>\vendor
For the same question you asked; the answer was this path for WAMP Server 64 BIT for Windows.
Then simply in your PHP Application change this:
require_once __DIR__ . '/vendor/autoload.php';
To:
require_once 'C:\Users\<Windows User Name>\vendor\autoload.php';
Find your windows username under C:\Users\
Before all this, as pointed before in B) , you need to run this command:
composer require <package name>
for facebook php SDK for example:
composer require facebook/graph-sdk
Thank you for asking this question; appreciated as it helped me fix similar issue and ended writing this simple tutorial.
First make sure you have installed the composer.
composer install
If you already have installed then update the composer.
composer update
If you have cloned your project from Github or got it from somewhere else, you will encounter this error. That's because you are missing the vendor folder and other files. The vendor folder contains packages which are dependent to your project. The package dependencies are stored in composer.json file and the folder was excluded while pushing to Github.
Fix this error by simply running:
composer install
Then you will get all the assets needed for your project.
First, review route inside index.php
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
in my case the route did not work, I had to review the directories.
For me
Just run this command first
composer dump-autoload
to add vendor folder.
then run this command
composer update --no-scripts
to update composer.
Create composer.json file with requisite library for ex:
{
"require": {
"mpdf/mpdf": "^6.1"
}
}
Execute the below command where composer.json exists:
composer install
In case of Drupal :
Use the web root folder of drupal to include autoload for ex:
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/vendor/autoload.php';
In case of other systems:
Use the root folder variable or location to include the autoload.php
I had this path in my machine:
C:/xampp5.0/htdocs/project-recordando-symfony/project-recordando-symfony
Then I ran composer install or/and composer update and it returned this error:
ErrorException ZipArchive::extractTo...
That error is because your path is too much long, I changed to:
C:/xampp5.0/htdocs/p-symfony/*
and worked!
run composer update. That's it
I was able to resolve by removing composer and reinstalling the proper way. Here is what I did:
sudo apt remove composer
sudo apt autoclean && sudo apt autoremove
Installed globally with the instructions from: https://getcomposer.org/doc/00-intro.md
Download from: https://getcomposer.org/installer
global install: mv composer.phar /usr/local/bin/composer
(Note: I had to move mine to mv composer.phar /usr/bin/composer)
I was then able to get composer install to work again. Found my answer at the bottom of this issue: https://github.com/composer/composer/issues/5510
In your project folder, the vendor folder is missing so you got this error:
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in
When you download the project through git, the project is downloaded without the vendor folder
You need /vendor because all your packages are there, including all the classes Laravel uses. The vendor directory contains your Composer dependencies.
The solution is simple, Just run this command:
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 and after that your project will start working normally.
This error occurs because of missing some files and the main reason is "Composer"
First Run these commands in CMD
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Then
Create a New project
Example:
D:/Laravel_Projects/New_Project
laravel new New_Project
After that start the server using
php artisan serve
In my case, It was due to the non-fully installation of the project, because I didn't have enough space on my hard disk
There will be a directory called "vendor" that needs to be in your root directory if you have a cloned repository and trying to set up that time this type of error occurring.
".gitingore" file has written code to not include vendor directory on GIT so after cloning GIT your project facing the issue of missing vendor directory.
Once you add vendor directory your project will start working again.
Change the auto_prepend_file property on php.ini
; Automatically add files before PHP document.
;http://php.net/auto-prepend-file
auto_prepend_file =
In linux first add github Personal access tokens
Navigate to GitHub's Personal Access Tokens page.
Hit "Generate new token" button.
Type something meaningful "Note", select "repo" as scope and hit "Generate token" button.
Take a note of the token.
5 type in terminal with you new "personal access token"
export COMPOSER_AUTH='{"github-oauth":{"github.com":"AB8cd4cab23a9d5399934a7d7698d3fa74e9cfAB"}}'
Run in terminal composer install

Problems installing laravel with composer [duplicate]

This question already has answers here:
How to place the ~/.composer/vendor/bin directory in your PATH?
(22 answers)
Closed 6 years ago.
Problem: I'm wanting to explore laravel 5, and failing miserably at installing it. I'm using this guide: http://laravel.com/docs/5.0 and need someone to help me understand the instructions.
Background and What I've Tried
I'm running Mac OSX 10.10.2 (Yosemite) and MAMP.
So far, I've downloaded Composer to my home folder using terminal. There is just a composer.phar file sitting there.
When I run:
composer global require "laravel/installer=~1.1"
I get the message:
Changed current directory to /Users/MYUSERNAME/.composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
I assume that is ok because when I run the following in terminal, I get the composer logo and a list of options
~ MYUSERNAME$ composer
I'm not 100% sure what the following means, from the Laravel Docs:
"Make sure to place the ~/.composer/vendor/bin directory in your PATH so the
laravel executable can be located by your system."
Because I can't figure it out, the following steps throw errors, such as:
-bash: laravel: command not found
I've been going through a few forums, and it's suggested that I need to update my PHP.ini file - this seems more related to Composer install, and not specifically Laravel. Because composer is working, this seems to be a dead end.
Ideally, I want to install Laravel 5 to the directory
HomeFolder/sites/test
because Composer.phar is in my home folder, I think the command should be:
php composer laravel new sites/test
or just
composer laravel new sites/test
As mentioned, it just (correctly) throws errors.
Question:
If anyone can help solve my total user error, by explaining what "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable can be located by your system." means to a n00b, that'd be really appreciated.
Many thanks!
Laravel is a PHP framework (makes writing PHP applications easy)
Composer is a PHP package and dependency manager. (makes installing and updating third party code libraries easy)
When you run
$ composer global require "laravel/installer=~1.1"
You're using composer to install the laravel/installer=~1.1 package into composer's "global" project folder (usually ~/.composer). This is what installed the command line program named laravel.
The command line program named laravel is a shell script for installing the PHP framework (Also named Laravel).
Your "Unix Path" is a list of folders where a command line script will search for an executable. Usually is has folders like /usr/bin, /usr/local/bin, etc. This is why when you run ls, you're actually running /usr/bin/ls -- the shell knows to check each folder in the path for a location. You can view your current path by typing
$ echo $PATH
So, the problem is composer installed the laravel command line program to a folder that's not in your unix path. You need to add this folder to your unix path. You can do this by running the following (assuming you're using bash, which is OS X's default shell)
$ PATH=$PATH:~/.composer/vendor/bin
If you run that, you should be able to run the laravel command line program and continue your installation.
Most people add this to their .bash_profile or .bashrc files. The Unix Stack Exchange has a lot of good information if you're interested in learning how to do this.
You can add the directory to the PATH variable by editing /etc/paths.
Here's a tutorial on how to do that.
Just add a line with:
~/.composer/vendor/bin
Then the laravel new command should work fine
If everything fails you can still use the composer create-project command to make a new laravel instance:
composer create-project laravel/laravel sites/test --prefer-dist
I added C:\Users\Leon\AppData\Roaming\Composer\vendor\bin instead of ~/.composer/vendor/bin to the Path variable.
Here is instructions on changing the path variable on Windows 10:
http://windowsitpro.com/systems-management/how-can-i-add-new-folder-my-system-path

Laravel error in /bootstrap/start.php: \Illuminate\Foundation\Application not found

So, I installed Laravel on a dev server (php5.5.3, standard installation, mcrypt installed), and I get the following error message:
Fatal error: Class 'Illuminate\Foundation\Application' not found in /[path_to_laravel_app]/bootstrap/start.php on line 14
Quite odd, and I haven't seen a solution to this file, although I've seen plenty of similar errors. Any advice welcome. Thanks!
/bootstrap/start.php is created after composer install by running Laravel's php artisan optimize. I've had a lot of issues on this during upgrades of Laravel, but removing /bootstrap/start.php, composer.lock, and the vendor directory and re-running composer install should fix this issue.
Run this command:
composer update --no-scripts
In my case I have added another required package(Guzzle) in the compser.json file separately(in the last line but it should be after the laravel package line) and updated the compsoser and came across this issue.
I have checked and my vendor/laravel folder has gone. That was preventing me to run any artisian command.
So "--no-scripts" worked for me as it prevents any scripts to be included before executing artisan.
You can use another method in case you are having issues.
Install another raw laravel and copy all the files from the vendor
file to your old repostory.
Change permission of storage and bootstrap folder to 775 or 777.
Delete everything in the session and view folder of storage/framework
Correct the composer.json. This might happen after you have added a new package configuration by dublicating the require tag.
Do not create yet another
require: {
..
}
use the previous defined one.
Then follow the accepted answer to re-install the packages.
Just Run the command
composer install --no-scripts
Or,
composer update --no-scripts
Double check your composer.json file. If you have error on "require": section this error will occur.
Just restore a previous version of composer.json file and run composer update.

fuelphp Composer is not installed. Please run "php composer.phar update" in the root to install Composer

I am trying to install fuelphp.
And getting the error as
Composer is not installed. Please run "php composer.phar update" in the root to install Composer
In my xampp/php directory I run a command
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
But once i run php composer.phar install composer could not find a composer.json in e:\xampp\php
How can i resolve and run fuelphp successfully can anyone help.
As of 1.7.1, we no longer supply the composer.phar file in the zip. It only has a limited shelf life (30 days before it starts complaining).
Instead we suggest you install composer yourself, either locally (specific for this fuelphp installation) or globally so you only have to install it once for all your projects.
Composer is a tool for dependency management in PHP, like npm for Node.js, bundler for ruby, and others.
It reads a file called composer.json with the dependent libraries your project needs and, finally, installs (downloads) them for you.
Fuelphp can be installed using composer, but there are several packages.
So, you need to create the composer.json with all needed fuelphp packages. Open notepad, save a file with the name composer.json (be sure to save it with ".json" extension) and put this content:
{
"require": {
"fuelphp/upload": "2.0.1",
"fuelphp/event": "0.2.1",
(...)
}
}
Note you need to insert at "(...)" the others fuelphp packages and the needed versions. You can check them all at https://packagist.org/ (type fuelphp at search). Packagist is the main Composer repository.
More information about Composer at this link.
Let me know if you need more information about it.
If you are running FuelPHP 1.7, the download comes with all Composer files you need. You need to run php composer.phar install in the root directory of FuelPHP (the same directory that contains the public folder and the fuel folder.
As long as you have v1.7 (I'm not sure if earlier versions contain the files), that directory will contain composer.json and composer.phar.
In folder fuelphp-1.7 (latest), there are two files: composer.phar and composer.json you need to cd into that folder and run:
php composer.phar install
If you don't have php in your path, you should do something like:
e:\xampp\bin\php\php5.4.16\php.exe composer.phar install
Use the full path to your php.exe. Remember your current working directory should be fuelphp folder where composer.phar and composer.json are.

Categories