Composer/Laravel fresh install error - php

I've got a brand new laravel installation on DigitalOcean, which I'm attempting to run a basic `composer update' on. However, I'm seeing the following error come up every time I try to update. I can't solve the problem with composer cacheclear, deleting the vendor/compiled.php file, or even reinstalling the entire framework.
I don't understand exactly what the error is in the first place, so I'm a bit lost. Any tips on what's going on?
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method Illuminate\Foundat
ion\Application::getCachedCompilePath() in /var/www/html/production/vendor/
laravel/framework/src/Illuminate/Foundation/Console/ClearCompiledCommand.ph
p on line 28

Delete the vendor/compiled.php and run composer update.
Source: https://laracasts.com/discuss/channels/general-discussion/runtimeexception-on-fresh-install?page=1

Related

Why Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found

I have a Laravel/Homestead project that is finally working locally. Now I'm trying to port it over to HostGator and can't get it running due to titled error. I've tried all the suggested solutions to no avail. Including:
composer require laravel/laravel
composer dump-autoload
composer install --no-scripts
composer update
composer update --no-scripts
Nothing works. Same error. If this is a clue, I also tried
php artisan clear-compiled
and get response of
Could not open input file: artisan
I'm about ready to give up on Laravel/Homestead. I've spent countless hours on this framework with nothing but problems to show for it. Would not recommend it to anybody.
You can see the error yourself here:
http://www.tekknow.net/MedAverter/medaverter/
Any suggestions before I throw in the towel?
For the artisan file, the artisan file is not required through includes, you have it in your root project, which is created when you create your Laravel project. Here is the file.
So you need to have that file in your project.
For the missing class, you try to require laravel/laravel but that is not the correct dependency. Again that github repo is a shell for a project, to have Laravel features you need to base of laravel/laravel and include laravel/framework.
Hope this clears up some confusing and can get you on the right track. Secondly you shouldn't port it over, but simply cloning your project and running composer install should be sufficient.
The problem turned out to be two issues.
1. The wrong version of PHP was running. If I ssh'ed into the hostgator server and did
php -v
It showed PHP 5.6.30 even though I had selected Php 7.1 in the cPanel PHP Selector. If I did
tekknow.net/phpinfo.php
it would say I was using 7.1. Called up HostGator tech support and they were able to change it to PHP 7.3.13.
Now if I do:
php artisan clear cache
I no longer get the error about
Parse error: syntax error, unexpected '?' in
/home1/sl1k7f3j/public_html/medaverter/bootstrap/app.php on line 15
which was an error caused by a version of php that doesn't support the ?? operator.
The second problem was a lack of memory issue. If I did
composer update
It would start to work but would fail in about 30 seconds with
Fatal error: Out of memory (allocated 709623808) (tried to allocate
34187559 bytes) in
phar:///opt/cpanel/composer/bin/composer/src/Composer/Json/JsonFile.php
on line 270
The HostGator tech rep could not figure out why that was happening but I got around that issue by manually uploading my local vendor folder to the host server.
Now when I go to http://tekknow.net/medaverter/ it works!

PHP Fatal Error in compiled.php after composer update

I am using laravel 5.1 in my production server. After update my composer, queue listener command starts throwing error as
PHP Fatal error: Cannot redeclare class Illuminate\Support\Traits\Macroable in /var/www/<site-folder>/bootstrap/cache/compiled.php on line 6109
I couldn't find out the problem. My site is working fine, and other artisan commands are working fine. But I can't run my queue. Please suggest me some sollution
You should run Run
php artisan clear-compiled
php artisan optimize
and make you sure you restart your queue.

PHP Artisan terminal command error (Type Error)

I recently ran composer self-update and composer update, and I now face the following error when running "php artisan serve" in my command console. The same error happens with all commands, not just "php artisan serve".
Error:
Line 217 in the directory mentioned in the error:
Let me know if you have any ideas about what I can do. This seems rather deep-rooted Laravel so I don't feel like messing with it.
Apparently in the short moment between my last update from 5.5.4 to 5.5.6 (roughly 15 min ago) and posting this issue on Stack Overflow, I ran composer update yet again just for the heck of it and it updated to 5.5.7. Seemingly technology advances super fast! The error now has resolved itself with 5.5.7.

Composer update - website stopped working

I updated the Composer using cmd window and got these errors:
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Darryldecode\Cart\CartServiceProvider' not found
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output:
The website is not online yet, and I'm running it using xampp.
Now, when i'm trying to access my web site through localhost, I get this error:
FatalErrorException in ProviderRepository.php line 146:
Class 'Darryldecode\Cart\CartServiceProvider' not found.
In the app.php file I have:
Darryldecode\Cart\CartServiceProvider::class,
in the Application Service Providers, and:
'Cart' => Darryldecode\Cart\Facades\CartFacade::class,
in the aliases.
Any ideas on how to get the website back?
Thanks!
Tty this steps
Temporary remove
Darryldecode\Cart\CartServiceProvider::class,
And
'Cart' => Darryldecode\Cart\Facades\CartFacade::class,
Type command
composer update
And then add this class
Because when you update composer he try to find this path before adding in your project, After updating your composer this class added in your folder

Laravel: PHP Fatal error: Class '...ServiceProvider' not found in /var/www/laravel/bootstrap/compiled.php on line #

I have been working on the same app for a little bit now, and I am moving it over to Laravel. This is not only my first experience with Laravel, but my first time using a PHP framework. It is awesome so far.
I have run into a problem in my testing, I am getting an error: Error Output: PHP Fatal error: Class '...ServiceProvider' not found in /var/www/laravel/bootstrap/compiled.php on line #
I am wondering what causes this error and how I can fix it . It gives me the direct line that is problematic. But I have no idea how to solve this issue.
I have tried a number of solutions including
composer install
composer update
composer dump-autoload
and others as well.
I have also attempted deleting the compiled.php file all together, but then it trips the same error on a different file. What is it causing this error, and how can I go about debugging it?
Thanks for help in advance!!
Try running the following command:
php artisan clear-compiled
If that gives you the same error, you'll have to manually delete the file:
rm app/bootstrap/compiled.php
For laravel 5.5.*
you can remove related ServiceProvider in this file
\bootstrap\cache\config.php

Categories