From cdf1aa832954d2dddf4224c7d809d2ab63e13230 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sun, 3 May 2026 23:34:34 +0100 Subject: [PATCH] Switch live-tests Apache setup to PHP-FPM (#3477) * fix(ci): switch live-tests to PHP-FPM to avoid Ondrej PPA failures Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/f6ad9206-9be8-4447-ac64-86f1db428c60 Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> * fix(ci): restart php8.4-fpm after pool config update to pick up APP_ENV=test Agent-Logs-Url: https://github.com/FOSSBilling/FOSSBilling/sessions/15bfabb2-a837-4d51-9e2b-9c016fe2ad7d Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> * Fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: admdly <2807620+admdly@users.noreply.github.com> Co-authored-by: Adam Daley Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/live-tests.yml | 34 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/live-tests.yml b/.github/workflows/live-tests.yml index fb15b862c..2afd5db99 100644 --- a/.github/workflows/live-tests.yml +++ b/.github/workflows/live-tests.yml @@ -89,44 +89,50 @@ jobs: - name: Setup Apache run: | - sudo apt-get update - sudo apt-get install --no-install-recommends \ - libapache2-mod-php8.4 php8.4 php8.4-common php8.4-intl \ - php8.4-mysql php8.4-xml php8.4-curl php8.4-fpm php8.4-mbstring \ - php8.4-opcache php8.4-gd - sudo a2enmod php8.4 + # Only install apache2 from the default Ubuntu repos — no Ondrej PPA needed. + # PHP 8.4 (including php8.4-fpm) was already installed by the Setup PHP step. + sudo apt-get install --no-install-recommends apache2 + sudo a2enmod proxy_fcgi setenvif rewrite sudo systemctl start apache2 - sudo a2enmod rewrite sudo mkdir /var/www/localhost # sudo unzip "FOSSBilling Preview.zip" -d /var/www/localhost sudo cp -r ./src/* /var/www/localhost - + + # Pass APP_ENV to the PHP-FPM pool so getenv('APP_ENV') works inside PHP. + # setup-php may have already started php8.4-fpm; use restart to ensure the + # updated pool config (with env[APP_ENV]) is reloaded. + echo "env[APP_ENV] = ${APP_ENV}" | sudo tee -a /etc/php/8.4/fpm/pool.d/www.conf + sudo systemctl restart php8.4-fpm + # Create a new Apache configuration file sudo tee /etc/apache2/sites-available/localhost.conf > /dev/null < ServerAdmin webmaster@localhost ServerName localhost DocumentRoot /var/www/localhost - + Options Indexes FollowSymLinks AllowOverride All Require all granted - SetEnv APP_ENV ${APP_ENV} - + + + SetHandler "proxy:unix:/run/php/php8.4-fpm.sock|fcgi://localhost/" + + ErrorLog \${APACHE_LOG_DIR}/error.log CustomLog \${APACHE_LOG_DIR}/access.log combined EOF - + # Enable the new configuration and disable the default one sudo a2ensite localhost.conf sudo a2dissite 000-default.conf - + # Test the Apache configuration sudo apache2ctl configtest - + # Restart Apache sudo systemctl restart apache2