Skip to content

Instantly share code, notes, and snippets.

@jwcastillo
Forked from muhajirinlpu/asdf-php.md
Created July 2, 2025 12:12
Show Gist options
  • Save jwcastillo/5c6e39afa2a48b84829faba1592a6747 to your computer and use it in GitHub Desktop.
Save jwcastillo/5c6e39afa2a48b84829faba1592a6747 to your computer and use it in GitHub Desktop.
asdf php laravel compatible install ubuntu & arch linux

This setup is suitable for Laravel

Install Requirements

  • ubuntu
sudo apt update && sudo apt install -y autoconf bison build-essential locate curl gettext git libgd-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev libsodium-dev openssl pkg-config re2c zlib1g-dev
  • arch
yay -S oniguruma libpng postgresql-libs readline sqlite openssl pkgconf re2c zlib libxml2 libzip percona-server-client autoconf bison base-devel curl gettext git gd curl libedit icu libjpeg-turbo

Run ASDF basic install

asdf plugin-add php https://github.com/asdf-community/asdf-php.git

asdf list-all php

choose version you want to install, in this case i will use 8.4.3

PHP_CONFIGURE_OPTIONS="--with-openssl --with-curl --with-zlib --with-readline --with-gettext --with-sodium" asdf install php 8.4.3

Install extensions

first we need to activate shell

asdf shell php 8.4.3

then, we will install redis, swoole

pecl install redis swoole xdebug
echo "extension=redis.so\nextension=swoole.so" >> ~/.asdf/installs/php/8.4.3/conf.d/php.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment