Laravel - Can't run project - php

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.

Related

My folder is not opened in XAMPP localhost

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

localhost phpMyAdmin wont open because I deleted composer folder inside it

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

php warning require error

I need to make a CRUD application with laravel, and i installed it just like how it is supposed too but now i get this error. I am just checking what version of laravel i have installed but somehow this shows up? i am no expert on any means. Can someone help.
C:\Users\Gebruiker\blog>php artisan --version PHP Warning:
require(C:\Users\Gebruiker\blog\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\Users\Gebruiker\blog\bootstrap\autoload.php on line 17
Warning:
require(C:\Users\Gebruiker\blog\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\Users\Gebruiker\blog\bootstrap\autoload.php on line 17 PHP Fatal
error: require(): Failed opening required
'C:\Users\Gebruiker\blog\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\Users\Gebruiker\blog\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required
'C:\Users\Gebruiker\blog\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\Users\Gebruiker\blog\bootstrap\autoload.php on line 17
When you first create a laravel project, there's a folder called vendor that laravel needs. Laravel the framework itself exists there among other folders there. There is a file named autoload.php that is vendor folder that loads all the packages that laravel uses. For you to get these packages, you'll run this command below
composer install
then laravel can now work, so can php artisan command too.
you have to update your wamp server, the php version has to be at least 5.7
When starting any new Laravel project make sure you run composer install

When i try to command through terminal 'php artisan serve' it gives Fatal error in ubuntu

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.

PhpStorm Laravel artisan Mamp

I'm learning PHP and wanted to work with Laravel, by doing so i follow tutorials and the guy explaining it uses artisan commands.
However I looked it up on how to add such commands but every time i go to command line tool support it gives me this error
Problem
Failed to parse output as xml: Error on line 2: Content is not allowed in prolog..
Command
php.exe D:\Websites\untitled\artisan list --format=xml
Output
Warning: require(D:\Websites\untitled\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in D:\Websites\untitled\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'D:\Websites\untitled\bootstrap/../vendor/autoload.php' (include_path='.;C:\php\pear') in D:\Websites\untitled\bootstrap\autoload.php on line 17
So i removed that project and installed Laravel again using "composer project"
and trying to add the artisan again doesn't work again with this fresh start.
Am I missing something? Or did I forgot something to do?
I hope someone can help me since I'm still a beginner and this would be a good learning school
Greetings
Ditger
Run composer install before using php artisan:
composer install

Categories