Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

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!
Thanks for this simple and painless guide. Works just as well on Ubuntu 20.04 and php 7.4 with a couple of edits from 7.2 to 7.4
What about the config that is in the file:
/etc/apache2/conf-available/php*.*-fpm.conf
<IfModule !mod_php8.c>
<IfModule proxy_fcgi_module>
# Enable http authorization headers
<IfModule setenvif_module>
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
</IfModule>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler "proxy:unix:/run/php/php8.0-fpm.sock|fcgi://localhost"
</FilesMatch>
<FilesMatch ".+\.phps$">
# Deny access to raw php sources by default
# To re-enable it's recommended to enable access to the files
# only in specific virtual host or directory
Require all denied
</FilesMatch>
# Deny access to files without filename (e.g. '.php')
<FilesMatch "^\.ph(ar|p|ps|tml)$">
Require all denied
</FilesMatch>
</IfModule>
</IfModule>
Shouldn’t we copy/paste this in our vhost file?
Or at least that part?
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler "proxy:unix:/run/php/php8.0-fpm.sock|fcgi://localhost"
</FilesMatch>
Hi, I tried the tips above and my web is suddenly can’t be accessed.
How do I reverse the Apache PHP ?
This will break your apache server. It broke mine. I was trying it on our staging server so I did not go crazy. I recommend not doing this on your production server. This tutorial is missing something for sure. I will update if I find something.
Hi,
are there any plans to update this article for anyone using PHP 8.0.11?
It is the default version as part of the stack provided by DO’s one-click WordPress installation.
Would be nice to get an update as to not brick the server when updating for FPM, as it seems some people have already bricked theirs.
In addition to the comment by @donchev about adjusting the configurations but at least adding the SetHandler line to the vhosts file, I think it is extremely important here to mention that if you are going to use this kind of configuration under any load you will need to visit the file:
/etc/php/7.x/fpm/pool.d/www.conf
and adjust the values there. For example, the default value of pm.max_children is 5 which for my traffic needs I have increased to 256. Just make sure you have the RAM to handle your adjustments. Also, read the comments in this file and adjust all the values related to server and request values.
In case that anyone needs this, with newer versions you might have to enable the PHP FPM apache config with:
sudo a2enconf php8.3-fpm
And then restart Apache.
I was trying to do this on Ubuntu 22.04 and php8.1 but kept getting just a Forbidden error. I was unable to get it to work even after trying all of the ideas here and more. I was able to reverse the changes though. I’d be grateful for any further pointers!