I was trying to install the php and laravel pkg on Linux Ubuntu, but everytime he shows this error package not installed use the latest version.
What should I do?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
You can use our article on How to setup a LAMP stack on Ubuntu 22.04 and just follow the steps for PHP to get it installed on your droplet:
You can include any additional packages to the install command as well. Once done you can check the PHP version with php -v
Hope that this helps!
Heya,
If you’re encountering an error stating “package not installed use the latest version” while trying to install PHP and Laravel on Ubuntu, it’s likely that there are issues with the package versions or repository configurations. Here are the steps to troubleshoot and resolve this issue:
sudo apt update sudo apt upgrade
Install PHP:
apt search php
- Install the latest version of PHP available (for example, if the latest is PHP 8.0):
sudo apt install php8.0
- Install necessary PHP extensions. Laravel requires some specific PHP extensions. You can install them with:
sudo apt install php8.0-xml php8.0-mbstring php8.0-mysql php8.0-sqlite3 php8.0-curl php8.0-gd
Install Composer: Composer is a dependency manager for PHP, required for installing Laravel.
Install Laravel: With PHP and Composer installed, you can install Laravel globally using Composer:
composer global require laravel/installer
Ensure that the Composer global bin directory is in your system's "PATH".
Check PHP and Laravel Versions:
php -v
- Verify Laravel installation:
laravel -v
Troubleshooting:
sudo add-apt-repository ppa:ondrej/php sudo apt update
- After adding a new PPA, try installing PHP again.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.