Mfast-cgi caddy file conf

Caddy version 2.4.2
When creating new topic could not find configuration template to fill in I’m on my phone that could be the issue?

Issue is how do I get fast-cgi working to process php pages I believe I need php5 and fpm installed and the following I want to know what Syntax i need to add in the caddy configuration file
fastcgi) unix//run/php/php-version-fpm. I couldn’t find anything on the comunity forum to confirm this
If someone could point me in the right direction or answer my post I would greatly appreciate it

It’s because you picked the “Plugins” topic category, which is not the right category for asking questions. Use the “Help” topic category instead, which prefills the text area with a template to fill (which I guess might be tricky for you considering it makes heavy use of markdown syntax to use code formatting to preserve whitespace when rendering config/logs sections).

I recommend you find and follow guides that explain the process of setting up nginx with PHP; the process for setting up PHP for Caddy is exactly the same as for nginx, and you’d benefit from more or better guides existing for nginx than Caddy.

The correct syntax is “php underscore fastcgi” (which is the directive name), followed by a space, then the address to connect to PHP-FPM, which may be either a unix socket file, or a TCP socket using port 9000. It depends on how you installed PHP-FPM which is used; on some systems it defaults to a unix socket, on others it defaults to a TCP socket. This is determined by PHP-FPM’s configuration.

Also – I strongly recommend installing PHP 7.3 or higher. PHP 5 is extremely outdated and no longer supported with security patches. It’s unsafe to run PHP 5.x versions.

Depending on what kind of PHP application you’re trying to serve, your config probably reads something like this, with the domain at the start, the root path, and the address to connect to PHP-FPM being the variables:

example.com

root * /var/www/html
php_fastcgi unix//run/php/php-8.0-fpm.sock
file_server

Note the version you were reading in the unix socket path was meant as a placeholder for whatever version you’re actually using – I filled it in with 8.0 above since that’s the latest version of PHP right now.

Thanks for pointing that out I am legally blind that doesn’t do me any favours but next time I post I will Endeavour moto do that again

So I will ask again can anyone point me in the right direction to getting fast-cgi working to process php I need to know what to put in the caddy file if anyone can provide assistance that would be great

Did you miss everything I wrote? I’m not sure what’s unclear from what I wrote.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.