Jump to content

Deployment with PHP-FPM and mod_proxy_fcgi

Corinna Schappacher

Recommended Posts

Hello Processwire Community,

I try to deploy Processwire on a server with Apache 2.4 and PHP 5.5 with PHP-FPM via mod_proxy_fcgi. My Apache virtual host config looks like this:

<VirtualHost *:80>
        ServerName myserver.net
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/myserver.net/public_html

        ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://$1

        <Directory /var/www/myserver.net/public_html>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted

I haven't done any changes to the .htaccess file which comes with Processwire.

With this configuration I can access my Processwire home page. But every sub page I want to access still shows the home page.

It seems like the query parameter $_GET['it'] is empty for every request.

Has anybody a clue, how i can tell apache to set the $it query parameter for Processwire correctly without using mod_fastcgi or mod_php?

Thanks in advance.


Link to comment
Share on other sites

Maybe, this has nothing to do with your problem, but want to be sure: Have you already tried this: https://processwire.com/docs/tutorials/troubleshooting-guide/page3 ?

I have read this page, but it doesn't solve my problem. The .htaccess file does get recognized by apache. The problem seems to be, that mod_proxy_fcgi ignores the "it" query parameter when redirecting to the fastcgi server.

Is my server configuration so rare, that nobody has encountered this problem before?

Link to comment
Share on other sites

I think, than it is more useful for you, to ask this question in an apache httpd (mod_proxy_fcgi?) forum.

Where / how is this mod_proxy_fcgi configured? Redirecting with GET-vars looks to me to be one of the most common things. But I have no clue about that apache module. :(

Link to comment
Share on other sites

  • 2 weeks later...

PW definitely works with FastCGI. Our configuration was a bit different though and we haven't experienced any problems like you described. For an example we were running PHP-FPM through UDS instead of TCP. We also map requests through SetHandler, not via ProxyPassMatch. It's basically the same way as Heroku runs it's PHP Dynos.

I could be able to help, if you can be more specific about the redirects. For an example, does the browser show the full path as the location? E.g. the address bar says http://<mysite>/parent1/parent2/child'>http://<mysite>/parent1/parent2/child, but the content is wrong (i.e. the content of the homepage, which means the problem is related to the rewrite). Or does the user actually get redirected to http://<mysite>/, when he/she tries to access http://<mysite>/parent1/parent2/child'>http://<mysite>/parent1/parent2/child?

Maybe it's the easiest to start by checking what happens when you go to http://<mysite>/index.php?it=/parent1/parent2/child Obviously replace the example names with real values first. The point of the test is to confirm GET-parameters are actually passed to PHP-FPM and that's why it's very important you "manually" pass the it-argument to the index.php -script.

Seeing the PHP-FPM configuration - and it's logs - might also help debugging your problem, but please try the above first and let me know.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...