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!

  • What extensions are you trying to make this work for? – Machavity May 19 '15 at 12:17
  • for urls without any extensions. the cms I um using creates clean urls with out any extensions but they're basically html files. – marp Jun 15 '15 at 11:12
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.