Skip to content

Instantly share code, notes, and snippets.

@dinhquochan
Created July 24, 2023 15:39
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dinhquochan/7b45be9c88e84c2dfba8cf7e694372e5 to your computer and use it in GitHub Desktop.
Save dinhquochan/7b45be9c88e84c2dfba8cf7e694372e5 to your computer and use it in GitHub Desktop.
Install PHP 8.2, Composer, MySQL 8 for Laravel Development on Ubuntu 22.04
## PHP
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.2-cli php8.2-dev php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \
php8.2-curl php8.2-imap php8.2-mysql php8.2-mbstring php8.2-xml php8.2-zip \
php8.2-bcmath php8.2-soap php8.2-intl php8.2-readline php8.2-ldap php8.2-msgpack \
php8.2-igbinary php8.2-redis php8.2-memcache php8.2-pcov php8.2-xdebug
## Composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
## MySQL
sudo apt instal mysql-server
sudo mysql -u root
#> MySQL command
drop user root@localhost;
create user root@'%' identified with mysql_native_password by '';
grant all privileges on *.* to root@'%' with grant option;
flush privileges;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment