Setup PHP 8.4 & Composer on Ubuntu
I’ve recently setup a new machine and thought that I’d setup a new environment for my laravel development. I’ve decided to document it, as it has been a while since I did one and I have to do a bit of googling to complete the entire setup.
- Add third party repo
- sudo
LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
- sudo
- Update
- sudo apt update
- Install
- sudo
apt -y install php8.4-cli php8.4-fpmphp8.4-zip php8.4-xml unzip php8.4-mysql php8.4-mbstring
- sudo
- Verify PHP installation
- php –version
- Download composer
- curl -sS https://getcomposer.org/installer -o composer-setup.php
- Install composer
- php composer-setup.php
- Move composer file to standard location
- sudo mv composer.phar /usr/local/bin/composer
- Verify composer installation
- composer –version
- Setup laravel for global use
- composer global require laravel/installer
- Add to path
- vi ~/.bash_profile
export PATH=~/.composer/vendor/bin:$PATH- source ~/.bash_profile