#!/bin/bash
# Setup script for fresh Ubuntu/Debian VPS
# Run: sudo ./vps-setup.sh

set -e
export DEBIAN_FRONTEND=noninteractive

echo "Installing PHP, Nginx, SQLite..."
apt-get update -qq
apt-get install -y -qq nginx php-fpm php-sqlite3 php-xml php-mbstring php-curl php-gd php-zip php-intl php-imagick

echo "Installing wp-cli..."
curl -fsSL https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o /usr/local/bin/wp
chmod +x /usr/local/bin/wp

echo "PHP-FPM socket path:"
php -r "echo ini_get('listen');"

echo ""
echo "VPS setup complete. Now run: ./deploy.sh"
