PHP
To get latest versions of PHP
Ubuntu
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Install latest PHP version.
sudo apt -y install php8.2-fpm
Add PHP extension
sudo apt install -y php8.2-mbstring php8.2-mysql php8.2-common php8.2-mysql php8.2-xml php8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap php8.2-mbstring php8.2-opcache php8.2-soap php8.2-zip php8.2-intl php8.2-bz2
Switch PHP
sudo update-alternatives --config php
Composer
Use command line instructions of Composer website to download and install latest version of Composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
You have just to copy installation instructions and composer will be download, this is an example:
sudo mv composer.phar /usr/local/bin/composer
sudo chown -R $USER ~/.config/composer/
To install global package like laravel
composer global require laravel/installer
Add this to .zshrc
vim ~/.zshrc
~/.zshrc
export PATH=~/.config/composer/vendor/bin:$PATH
source ~/.zshrc
Now you can use composer
.
Table of Contents