I just updated my Laravel 5.4.23 to 5.5 and tried running my tests for PHPUnit and I am receiving the following error and I am trying to scour around the internet and find out people who have done so and have received the same error message but have not had any luck.
Has anyone received this error?
Call to undefined method Whoops\Handle\PrettyPageHandler::setApplicationPaths()
setApplicationPaths() doesn't exist in the 2.0.0 release of the filp/whoops library. Essentially, it's not a problem with Laravel 5.5 but with that specific version of Whoops. I experienced the same issue until I updated the library version I was using to the newest stable version of Whoops (2.1.10), which I did by changing the dependency version in my composer.json file "filp/whoops" : "~2.1.10" Once you make that change, run composer update and the error should go away.
(1/5/2018) Editing to add that this doesn't appear to be an issue in later releases of Laravel 5.5, so changes to the version of filp/whoops should not be necessary at this point.
Have you tried clearing all the caches via php artisan cache:clear or php artisan view:clear?
Related
I have a PHP solution which is being moved from PHP7.4 -> PHP8.1. This required updating many packages used, such as Symfony and Doctrine. Everything seems fine, but when I go to run my deployment script, which re-generates Doctrine proxy files, I encounter an error:
Fatal error: Uncaught Symfony\Component\Console\Exception\LogicException: An option named "em" already exists. in /usr/local/store/vendor/symfony/console/Input/InputDefinition.php:232
I've tried playing with the Doctrine and Symfony versions which are required (I've tried symfony/console 5.4.16 and 6.2.5, and I had to downgrade doctrine/dbal from 3.5.1 to 2.13.9 to fix a different issue in the same deployment step), but I can't find any combination of packages that solves this issue.
The deployment is running the following:
php ./vendor/bin/doctrine-module orm:generate-proxies --em=orm_databasename
I am new to Laravel. I have installed laravel on localhost using: composer create-project laravel/laravel news. Then, server.php to index.php, and copied .htaccess from public to root. However, the installation is displaying laravel default welcome view, successfully.
The pain starts, when I have uploaded it to the server. At first, it's displaying following message:
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".
I have added the following lines to the composer.json (in config):
"platform-check": false
and then omposer dump-autoload. By doing this, above message gone, and the page is displaying 500 Internal Server Error.
I have tried every possible solution, still nothing working till now.
Laravel Version: 8.74.0
Server Php Version: 7.4.26
Please help me to solve this issue. If you need any other information, I will provide.
I think it is better to add a php8 version on your local than downgrading your laravel version to 7.
Your Composer dependencies require a PHP version ">= 8.0.2" - tells that your laravel require you to have have php version 8.0.2 or higher.
Try installing a lower version of laravel. For example:
composer create-project laravel/laravel=8.0.* news
hi guys I need help for this case
I can't run laravel 5.7 on php8, when I do "php artisan serve"
I got error:
thrown in /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 838
PHP Fatal error: Uncaught ErrorException: Method ReflectionParameter::getClass() is deprecated in /var/www/html/myProject/vendor/laravel/framework/src/Illuminate/Container/Container.php:838
I have tried to update composer required php version form "^7.1.3" to "php": "^7.1.3|^8.0",
and when I run composer update I got another error.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v5.7.0, ..., 5.7.x-dev] require php ^7.1.3 -> your php version (8.0.3) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.7.* -> satisfiable by laravel/framework[v5.7.0, ..., 5.7.x-dev].
I hope any body sharing what is solution for this case
Both errors are related.
According to The Official Docs Laravel 5.7 only supports PHP >= 7.1.3.
Trying to force it to run on PHP8 will cause some funky things as PHP8 has a lot of game changing fixes/migrations/deprecation. All of which can be found here.
If you want to use PHP8, use Laravel 8. If you want to use Laravel 5.7, use PHP7.
If you must use PHP8 and Laravel 5.7, I suggest you change the composer requiremnet to "php": "^8.0", but be prepared to troubleshoot a lot.
Laravel 5.7 is not compatible with PHP 8. If you want to get PHP 8 support, make sure you're at the latest version of Laravel 6, 7, or 8.
There are also a couple of commonly used dependencies you'll need to update in your composer.json file:
PHP to php:^8.0
Faker to fakerphp/faker:^1.9.1
PHPUnit to phpunit/phpunit:^9.3
You can putting exit($e); in App\Exceptions\Handler::report() to give a better error message.
delete vendors file
then run the command composer install
I've installed the admin package Voyager (without dummy data) on my Laravel project and when I want to create a user to access the admin panel with the following command: php artisan voyager:admin admin#admin.com --create, I get the following error:
After a little bit of searching, I found this link: https://github.com/the-control-group/voyager/issues/5082 => saying that this command does not work with PHP 7.4 and to make it work, I should either upgrade to PHP 7.4.1 or downgrade to PHP 7.3.
I'm using Wamp Server and decided to downgrade to PHP 7.3.12 since this version exists by default in C:\wamp64\bin\php
I have also edited composer.lock and composer.json in my project and then ran the command composer dump-autoload. But it still doesn't work. Am I missing something?
Had the same issue, upgraded to php 7.4.27 and it worked.
When upgrading Laravel 5.5 to 5.7 and running composer install I see this error.
Has any one else experienced something similar?
I also upgraded php from 7.1 to 7.2 at the same time using forge, after reverting the code to laravel 5.5 staying with php 7.2 was not an issue.
There were changes from Laravel 5.6 to 5.7 that might have caused this:
From the Upgrade Notes:
A new data directory has been added to storage/framework/cache. You should create this directory in your own application:
mkdir -p storage/framework/cache/data
Then, add a .gitignore file to the newly created data directory:
cp storage/framework/cache/.gitignore storage/framework/cache/data/.gitignore
Finally, ensure that the storage/framework/cache/.gitignore file is updated as follows:
*
!data/
!.gitignore
There was also a change from Laravel 5.5 to 5.6, but from what it looks like this seems unlikely to be the cause.