I am new to php and usage of composer in php. I am using windows 10.
While trying to delete previous installation of composer I think I have mistakenly deleted the composer folder inside phpMyAdmin. Now I am getting the below error while trying to access http://localhost/phpmyadmin/ :
Warning: require_once(C:\xampp\phpMyAdmin\vendor/composer/autoload_real.php): failed to open stream: No such file or directory in C:\xampp\phpMyAdmin\vendor\autoload.php on line 5
Fatal error: require_once(): Failed opening required 'C:\xampp\phpMyAdmin\vendor/composer/autoload_real.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\phpMyAdmin\vendor\autoload.php on line 5
was there supposed to be a composer folder inside phpMyAdmin by default? Did I delete something that was used by mysql?
How do I solve it?
The vendor folder is required yes. If there's a composer.json file present in your phpmyadmin folder you can run composer install to fetch all dependencies into the vendor folder.
Go To xampp>phpMyAdmin first then run "composer install" on your git bash or any other terminal.I hope it will work
Related
Guys i am frustrated now, I just installed XAMPP yesterday. And I created a folder named "MyProgram" and there is one PHP file inside and basically its just a "Hello World" program. It works fine in the apache localhost.
And now when I created another new folder "MyAPI", I am trying to build another PHP thing with Vimeo API. But this time, no matter how many times I tried, I cant open my "MyAPI" folder on the localhost anymore. Usually when we open in the localhost, there will be a menu for us to choose what file to be opened, but im not sure why this is not working in this case. These are the error message:
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory in D:\XAMPP\htdocs\MyAPI\index.php on line 9
Fatal error: require(): Failed opening required 'vendor/autoload.php' (include_path='D:\XAMPP\php\PEAR') in D:\XAMPP\htdocs\MyAPI\index.php on line 9
And FYI, this my folder:
And this is how I installed my composer:
You need to install your project dependencies first.
Open your terminal
Navigate to your project directory:
cd D:\XAMPP\htdocs\MyAPI\
Run composer install
try to run :
composer install
composer update --no-scripts
If you get the same error also when you run them
Just run this command first
composer dump-autoload
also make sure you run these commands inside the project folder
A friend send me a project but it is give me an error when i try run.
I go to project location and execute php artisan serve but i have this error:
Fatal error: require(): Failed opening required '/project1/bootstrap/../vendor/autoload.php' (include_path='.:') in /project1/bootstrap/autoload.php on line 17
When i run composer install i have this error:
[ErrorException]
file_put_contents(/project1/rev2/bootstrap/cache/ser
vices.php): failed to open stream: No such file or directory
What is the problem?
Thank you
Do you compose installed ? if not you can install it form here.
https://getcomposer.org/
Once composer is installed then you can run php artisan serve or you can place the project in the wamp/xampp project directory and run like this.
http://localhost/projectname/public
Make sure you have /project1/rev2/bootstrap/cache directory in your project location if not, you have to manually create it.
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 following all steps to run a PHP Google Calendar Api. I followed this link: https://developers.google.com/google-apps/calendar/quickstart/php . In step 4 it asks to run quickstart.php, but as after running the file, it displayed me this error :
Warning: require(vendor/autoload.php): failed to open stream: No such
file or directory in
C:\xampp\htdocs\Calendar\google-api-php-client-master\quickstart.php
on line 2
Fatal error: require(): Failed opening required 'vendor/autoload.php'
(include_path='.;C:\xampp\php\PEAR') in
C:\xampp\htdocs\Calendar\google-api-php-client-master\quickstart.php
on line 2
Here's a check-list for you to go down with Composer and vendor/autoload.php:
Does your composer.json file exist in the root of your project? (Note: This may be up a level from your document root for your web server.)
Does the vendor folder exist in the same folder as your composer.json?
Are you using the correct relative path to find your vendor/autoload.php file?
If composer.json isn't in your project root, move it there. It's where it belongs and things will continue to go wrong for you until it's there.
The vendor folder and its autoload.php file are both automatically created when you run php composer.phar install or php composer.phar update. If they're missing, you need to run php composer.phar install.
Once you've verified that vendor/autoload.php exists and is in the correct location, make sure that you have a good relative reference to that file with your require statement.
I solve this issue using the followed command:
composer dump-autoload -o
I would execute it inside of the application folder.
Example:
c:\<< your_app_folder >>\composer dump-autoload -o.
After that, you will see the "vendor" folder. The autoload.php file will inside.
For more information, access the link:
http://phpenthusiast.com/blog/how-to-autoload-with-composer
This fixed it for me
make sure you have composer installed then try the below command in your terminal
composer update
I have just pulled a remote Laravel project from Github and ran composer install to create the vendor folder.
However, this returns an error in the terminal:
[RuntimeException]
Could not scan for classes inside "/Applications/MAMP/htdocs/imperialnet/ve
ndor/patchwork/utf8/src/Normalizer.php" which does not appear to be a file
nor a folder
And this error in the error log:
PHP Fatal error: require(): Failed opening required '/Applications/MAMP/htdocs/app/vendor/symfony/var-dumper/Resources/functions/dump.php' (include_path='/Applications/MAMP/htdocs/app/vendor/phpseclib/phpseclib/phpseclib:.:/Applications/MAMP/bin/php/php5.6.2/lib/php') in /Applications/MAMP/htdocs/app/vendor/composer/autoload_real.php on line 58
Looking in Vendor > patchwork > utf8 there is no SRC folder? What is going with composer or ?
I had the same problem. Deleting the vendor folder and the composer.lock file and then running composer install solved the issue.
You may write in console: composer update --dev