By Rashwan
i found this article https://www.digitalocean.com/community/tutorials/how-to-configure-apache-http-with-mpm-event-and-php-fpm-on-ubuntu-18-04
but # on Ubuntu 18.04, ist still valid for ubuntu 24?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya,
Looking at the tutorial it’s still valid for Ubuntu 24.04. It should guide you through the proccess of installing fastCGI for Apache without a problem.
Give it a try and let me know how it goes.
Hey Rashwan! 👋
The article you found is still mostly valid for Ubuntu 24, though there are a few differences in package names and potentially new configuration steps in the newer version.
Here’s an updated guide on how to install and configure FastCGI with Apache on Ubuntu 24.
First, install Apache and PHP-FPM on Ubuntu 24:
sudo apt update
sudo apt install apache2 libapache2-mod-fcgid php-fpm
During the installation note the PHP version:
php -v
Once installed, you need to enable some required Apache modules:
sudo a2enmod actions fcgid alias proxy_fcgi
This makes sure that Apache can work with PHP-FPM via FastCGI.
If you want to use MPM Event as per the article that you’ve shared:
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
Now you’ll configure Apache to pass PHP requests to PHP-FPM. Enable the PHP FPM config:
sudo a2enconf php8.3-fpm
After all that, restart Apache to apply the changes:
sudo systemctl restart apache2
Make sure PHP-FPM is running and configured correctly by checking the status:
sudo systemctl status php8.3-fpm.service
Change the php8.3-fpm
with the PHP version that was installed.
To test your setup, create a simple info.php
file in your web root:
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
Now visit http://your-server-ip/info.php
in your browser. You should see the PHP information page, which confirms that PHP-FPM is working through FastCGI.
The basic setup for FastCGI on Apache with Ubuntu 24 is pretty similar to Ubuntu 18.04. Just make sure to use the updated packages and modules in the newer version of Ubuntu.
Let me know if you run into any issues! 🚀
- Bobby
Heya, @rashwandolphin
As mentioned the process is almost the same minus few package name differences.
Let us know if you’ve run into issue and now you’re unable to continue with the process. We’ll be happy to help!
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.