caddy: Can't server any PHP content

OS 10.14.6

Removed all hombrew php installs

Installed php 7.4 via homebrew


❯ /usr/local/sbin/php-fpm -v
PHP 7.4.4 (fpm-fcgi) (built: Mar 19 2020 20:12:43)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies

Testing via caddyfile:

❯ cat caddyfile
:8000 {
    root * /Users/xxxx/support/xxxx/website/xxxx_dev01
    php_fastcgi 127.0.0.1:9000
    file_server
}
I get static HTML rendered but no PHP content.

php-fpm is running and listening on port 9000

❯ nc -vz 127.0.0.1 9000
found 0 associations
found 1 connections:
     1:	flags=82<CONNECTED,PREFERRED>
	outif lo0
	src 127.0.0.1 port 59367
	dst 127.0.0.1 port 9000
	rank info not available
	TCP aux info available

Connection to 127.0.0.1 port 9000 [tcp/cslistener] succeeded!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 30 (11 by maintainers)

Most upvoted comments

I’m cheering you on. Let me know if Caddy can be of any further help.

You should be able to change the instances of .php in the expanded form in the docs to .html, see how far that gets you. Let us know!

I did that and it worked. Thanks. v2 of the site will be fixed once I get my job back. Working for free to try and save our livelihoods currently.

Understood - but I don’t have time to change the whole site. Trying to react quickly due to Covid-19 and loss of 95% of our airline business.