cant launch laravel site - php

Ive tried setting up a laravel instance many times now on Ubuntu 16.04 system. I have php5.6 and apache2 installed. Installed composer following the instructions on there site and than ran (composer global require "laravel/installer") to install laravel.
I've added (export PATH="~/.composer/vendor/bin:$PATH") to .bashrc and then create new laravel project with laravel new project. to test if it was working I cd into project and ran (php artisan serve) but keep coming up with
PHP Warning: require(/home/dave/project/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/dave/project/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/home/dave/project/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/dave/project/bootstrap/autoload.php on line 17
Can anyone help get me going.

Related

Composer not working with laravel after Windows update 1903

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

How can I run this PHP website and host it on HostGator?

My friend, who just started a company, sent me this website (https://github.com/lexaugustin/bamboufacile) that someone built for him out of a PHP template, so I can host it for him on "hostgator.com". When I run the public folder with XAMPP, I only see the template website, and when I try to run the server.php that is in the root directory, I get these two errors:
1) "Warning: require(/opt/lampp/htdocs/public/../vendor/autoload.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/public/index.php on line 24
2) Fatal error: require(): Failed opening required '/opt/lampp/htdocs/public/../vendor/autoload.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/public/index.php on line 24.
Can someone help me run this file and tell me how to host PHP website on hostgator, please? The tutorials on hostgator haven't worked for me.
The project link you have mentioned is a laravel project. The error shows it has missing dependencies. So first thing you will need to install composer to install its dependencies.
Once you are done with the installation open command line and cd to your project directory in xampp htdocs. Run this below command to install the dependencies. Also you will need minimum php 7.1.3 in your xampp and hostgator to run this project.
composer install

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

Why am I getting this error message after I obtained my Laravel project from my GIT repository?

I am new in Laravel and I have the following problem.
I developed a Laravel 5 project on an old computer, and I put the code on a GIT repository. I retrieved my source code on my new laptop from the repository.
But I am facing problems while running the Laravel project on Apache and I am obtaining this error message on my Laravel website instead:
Warning: require(C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\HotelRegistration\bootstrap/../vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php on line 17
The C:\xampp\htdocs\HotelRegistration\bootstrap\autoload.php is present in my project
Why am I facing this issue? What is the problem? What am I missing? How can I fix this issue? How can I try to solve this issue?
You need to run
composer install
command to install packages. By default vendor directory is ignored when committing to GIT (this is good) so if you pull data from repository you need to install all packages running above command.

Getting error while running Yii2 project on windows 8.1

I have successfully installed Yii2 using composer on windows 8.1. I am using Xampp server but I am not able to run my project successfully.
I am getting this error:
Warning: require(C:\xampp\htdocs\application\web/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\application\web\index.php on line 7
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\application\web/../vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\application\web\index.php on line 7
I have also given proper permissions and set the cookie validation key but nothing is working.
Thanks for help.
Error is self explainable. There is no autoload.php file in vendor folder. It's generated after all vendor packages will be installed.
Use composer install command to install all packages.

Categories