php artisan --version Install PHP: sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php sudo apt update apt install php7.4 Version check: update-alternatives --config php Disable: sudo a2dismod php8.1 Enable: sudo a2enmod php7.4 service apache2 restart Reference: https://bytexd.com/fix-laravel-return-type-of-illuminatesupportcollectionoffsetexistskey/