Install PHP and Extensions
sudo apt update && sudo apt install -y \
php8.2-fpm php8.2-cli php8.2-mysql php8.2-pgsql \
php8.2-redis php8.2-curl php8.2-xml php8.2-mbstring \
php8.2-zip php8.2-gd php8.2-intl php8.2-bcmathInstall Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --versionInstall Node.js (for frontend tooling)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejsPHP Configuration for Development
Edit /etc/php/8.2/fpm/php.ini:
display_errors = On
error_reporting = E_ALL
memory_limit = 512M
upload_max_filesize = 100M
post_max_size = 100M
max_execution_time = 300Xdebug for Debugging
sudo apt install -y php8.2-xdebugEdit /etc/php/8.2/fpm/conf.d/20-xdebug.ini:
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_host=YOUR_LOCAL_IP
xdebug.client_port=9003MariaDB for Development
sudo apt install -y mariadb-server
sudo mysql_secure_installation
# Create a development database
mysql -u root -e "CREATE DATABASE myapp; CREATE USER 'dev'@'localhost' IDENTIFIED BY 'devpass'; GRANT ALL ON myapp.* TO 'dev'@'localhost';"Useful Tools
# PHP CS Fixer (code formatting)
composer global require friendsofphp/php-cs-fixer
# PHPStan (static analysis)
composer global require phpstan/phpstan
# Laravel installer
composer global require laravel/installer