First, uninstall any PHP/apache deps you might have previously installed. Do a brew list
and look for any matching packages.
Switch to root first.
apt-get update \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git sqlite3 libcap2-bin libpng-dev
add-apt-repository -y ppa:ondrej/php
apt update \
&& apt install -y php8.3-cli php8.3-dev \
php8.3-pgsql php8.3-sqlite3 php8.3-gd \
php8.3-curl \
php8.3-imap php8.3-mysql php8.3-mbstring \
php8.3-xml php8.3-zip php8.3-bcmath \
php8.3-intl php8.3-readline \
php8.3-msgpack php8.3-igbinary php8.3-redis \
php8.3-pcov php8.3-xdebug php8.3-fpm
php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer
I recommend using a tool like fnm to manage your node versions, but if you don't really care: purge your existing nodejs installation (if any) and run the following.
curl -sL https://deb.nodesource.com/setup_20.x | bash - \
&& apt install -y nodejs
If you've skipped this step, just make sure your node version is 20.x.