Trying to problem solve "Fatal Errors" and "No Such File or Directory" - laravel

I'm at a total loss here.
All I am trying to do is clone a Laravel Project onto my local mac machine and I've probably spent 10 - 12 hours on this and I keep getting the same errors over and over.
I've tried Homestead, MAMP and now I am on Valet.
I can load the app but all the links are broken so the CSS and JS don't load.
After I clone (via bitbucket) the project I hit the test site on my machine and I get this error:
Warning: require(/Users/henry/sites/nestdb2017/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/henry/sites/nestdb2017/bootstrap/autoload.php on line 17
Fatal error: require(): Failed opening required '/Users/henry/sites/nestdb2017/bootstrap/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/php/7.3.9_1/share/php/pear') in /Users/henry/sites/nestdb2017/bootstrap/autoload.php on line 17
The next thing I do is I try to install the missing vendor files by doing this:
composer update --no-scripts
which then throw the broken links.
Literally I'm going to have to throw the towel in here...
It's unbelievable how hard this is.
Is it because the source files are corrupt in the first instance??

Try
composer install
php artisan clear-compiled
Then
composer dumpautoload
Tell us the results.

Related

Why do I have to "composer install" whenever I switch to a branch? Does it kill my memory?

Context: I am roughly new to Laravel and Github. I am working on a project with 3 other people, and we have created all our individual branches. But every time, I switch to their branch (which I am to successfully) but whenever I am trying to run the server on port 8000 I get the following error:
C:\Users\Einstein\Documents\Program\Project>php artisan serve
PHP Warning: require(C:\Users\Einstein\Documents\Program\laravel\Project/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\Einstein\Documents\Program\laravel\Project\artisan on line 18
Warning: require(C:\Users\Einstein\Documents\Program\laravel\Project/vendor/autoload.php): failed to open stream: No such file or directory in C:\Users\Einstein\Documents\Program\laravel\Project\artisan on line 18
PHP Fatal error: require(): Failed opening required 'C:\Users\Einstein\Documents\Program\laravel\Project/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users\Einstein\Documents\Program\laravel\Project\artisan on line 18
Fatal error: require(): Failed opening required 'C:\Users\Einstein\Documents\Program\laravel\Project/vendor/autoload.php' (include_path='C:\xampp\php\PEAR') in C:\Users...8```
However, I am to run the project whenever I perform composer install. Why is that so? It seems like I have to rerun the packages whenever I am switches to branches, does it kill my computer memory? If I have to reinstall packages (this is my assumption whenever I perform composer install) will kill my computer memory.
Thanks.
It is most likely because you are pulling in cached files calling the other peoples local paths and not yours. When you run composer install it pulls all the dependencies listed in the composer.json file to the /vendor folder, then rebuilds the config cache.
You can try and just rebuild the cache instead of re-installing all the dependencies with:
composer dump-autoload and php artisan clear:cache

Laravel 5 issue : libraries/admin/ does not exist and could not be created

I'm trying to install laravel from git. I cloned the repository and tried the command
php artisan serve
But It gave this error message.
Warning:
require(C:\wamp64\www\reguard\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\wamp64\www\reguard\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required
'C:\wamp64\www\reguard\bootstrap/../vendor/autoload.php'
(include_path='.;C:\php\pear') in
C:\wamp64\www\reguard\bootstrap\autoload.php on line 17
and I ran a composer install
But it stopped with this error,
[RuntimeException] libraries/admin/ does not exist and could not be
created.
So I ran a composer du as the first comment but now getting this,
[Symfony\Component\Debug\Exception\FatalErrorException] Class
'R2S\Admin\Providers\AdminServiceProvider' not found
Hope someone can help.

How to configure the Laravel built-in web server?

I am running this command:
C:\xampp\htdocs\notebook>php artisan serve
However I get this error:
Warning: require(C:\xampp\htdocs\notebook\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in C:\xampp\htdocs\notebook\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\notebook\bootstrap/../vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\notebook\bootstrap\autoload.php on line 17
After creating a project or cloning existing one you should run composer install command which will install all dependecies and will create autoload.php file.
That is an import error.
Everytime you have one of these, you should try to run composer dump-autoload.
Most of the time, this command will fix your imports.
It looks like you might not have installed the required dependencies yet. You should do so using the composer package manager, like so:
C:\ProgramData\ComposerSetup\bin\composer install

Fresh CentOS 7, first Laravel Installation.Composer install breaks

I am fallowing this tutorial:
http://linoxide.com/linux-how-to/install-laravel-php-centos-7-ubuntu-15-04/
And on step 5) when running composer install in the project directory it starts to do staff, as expected, until this happened:
Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
PHP Fatal error: Undefined constant 'Illuminate\Session\TokenMismatchException' in /var/www/laravel-develop/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 779
Script php artisan optimize handling the post-install-cmd event returned with error code 255
What is the problem?
Thanks, Aleks
start creating a project (after updating composer) instead of downloading the referenced file do the following
from your terminal type in cd /var/www/
then type composer create-project laravel/laravel laravel-develop
your composer should download the latest version of Laravel
try it this way feel free to ask any questions.
Good Luck

unable to run laravel 4

I thought it was about time to look at a PHP Framework so I chose laravel. However, getting it running is causing me grief.
I followed the video from nettuts installing laravel 4 and at 5.05mins into the video he uses the php command-line server command (available from 5.4) php -S localhost:8888 -t public/ followed by confirming that it works via localhost:8888 in the browser which displays 'Hello Wolrd!'
I have XAMPP installed and my version of PHP is 5.3.15. I attempted to test it by doing http://localhost/learning-laravel/public/
At this point I have already downloaded composer and installed the dependancies successfully.
But I keep getting the following error:
Warning: require(/Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/../vendor/autoload.php) [function.require]: failed to open stream: No such file or directory in /Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/autoload.php on line 17
Fatal error: require() [function.require]: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/../vendor/autoload.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Applications/XAMPP/xamppfiles/htdocs/learning-laravel/bootstrap/autoload.php on line 17
Inside my learning-laravel folder I do have bootstap/autoload.php
Can someone please help? Thanks.
I had another look at my folder structure and I noticed that composer had not run correctly and there were missing files. I've reinstalled it and it appears to be working.

Resources