I am using
- UBUNTU 20
- Vagrant 2.2.9
- Homestead release branch
- Composer version 1
After installing vagrant and homestead.
Whenever I hit any laravel project then I got this error.
Deprecated: Method ReflectionParameter::getClass()
I also update my PHP version using these below commands
vagrant ssh
sudo update-alternatives --config PHP
sudo update-alternatives --set php /usr/bin/php7.1
sudo update-alternatives --set phar /usr/bin/phar7.1
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1
sudo update-alternatives --set phpize /usr/bin/phpize7.1
sudo update-alternatives --set php-config /usr/bin/php-config7.1
After this when I check PHP version then it shows 7.1
I don’t know after changing the PHP version which service I need to restart?
2
Answers
it simply means that the method is no longer supported in PHP 8.
Just open your Homestead.yaml file and add your PHP version in the sites section.
And run
mmm put a phpinfo() in your index and tell me your results. I run in homestead the following command "php71" and the output of "php -v" is as expected
However in my phpinfo() located in the index.php of the project the output is PHP Version 8.0.5 :S