2

Does anyone know how to properly configure PHP/FastCGI on a CentOS 7 machine using Apache 2.4?

In the Apache Virtual Host config file, I have this:

 <FilesMatch \.php$> 
    SetHandler "proxy:fcgi://127.0.0.1:9000" 
</FilesMatch> 

It works but only for files ending in .php (I can access the control panel but not the website)

The CMS outputs pages without any extensions and I get an "Access Denied." error when I access a page.

The pages (CMS templates) don't contain php code but they seem to be affected by this. How can I make sure, this also works for pages without any extensions?

Thanks a lot!

Machavity
  • 834
  • 10
  • 26
marp
  • 23
  • 1
  • 1
  • 3

1 Answers1

0

What you'll have to do is set up an actual PHP page first. For instance, Wordpress uses a single index.php and then uses a mod_rewrite rule to redirect all traffic there. So all you see are clean URLs but it's still a PHP file with a PHP extension running the whole show.

This thread talks about how to point all your URLs to a single PHP file. Remember that you can do this in both .htaccess as well as your Apache configs.

Machavity
  • 834
  • 10
  • 26