[SOLVED] Apache2 + php7.0-fpm


#1

Hello,

I am trying to migrate from a local php7 to a fcgi version. I have some troubles to make the right configuration.
I see the calls on the php-fpm access.log but I think I have an issue with either a rewrite url or the proxyPass configuration I used.

I have tried a lot of things but still not the right one. When I dump the call received in the php-fpm I see them but not handled properly.I have added this to my vhost configuration :

ProxyPassMatch ^(.*\.php(\?.*)?)$ fcgi://192.168.0.1:9000/var/www/owncloud

And here is the .htaccess auto generated :

#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php
<IfModule mod_rewrite.c>
  Options -MultiViews
  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]
  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]
  RewriteCond %{REQUEST_FILENAME} !\.(css|js|svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$
  RewriteCond %{REQUEST_FILENAME} !core/img/favicon.ico$
  RewriteCond %{REQUEST_FILENAME} !/remote.php
  RewriteCond %{REQUEST_FILENAME} !/public.php
  RewriteCond %{REQUEST_FILENAME} !/cron.php
  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update.php
  RewriteCond %{REQUEST_FILENAME} !/status.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v1.php
  RewriteCond %{REQUEST_FILENAME} !/ocs/v2.php
  RewriteCond %{REQUEST_FILENAME} !/updater/
  RewriteCond %{REQUEST_FILENAME} !/ocs-provider/
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/.*
  RewriteRule . index.php [PT,E=PATH_INFO:$1]
  RewriteBase /
  <IfModule mod_env.c>
    SetEnv front_controller_active true
    <IfModule mod_dir.c>
      DirectorySlash off
    </IfModule>
  </IfModule>
</IfModule>

I use the same data on an nginx server and on this one it is ok but not with apache.

Here are the logs I get on the php-fpm with both nginx and apache for a call on the login part of owncloud :

nginx - method GET - query  - mark  - uri /login - status 200 - file /var/www/owncloud/index.php
nginx - method GET - query v=e81ad89ccd551814ed7c72139b5cf64d - mark ? - uri /core/js/oc.js - status 200 - file /var/www/owncloud/index.php
nginx - method GET - query  - mark  - uri  - status 200 - file /var/www/owncloud/cron.php


apache - method GET - query  - mark  - uri /core/templates/404.php - status 200 - file /var/www/owncloud/core/templates/404.php
apache - method GET - query  - mark  - uri /core/templates/404.php - status 200 - file /var/www/owncloud/core/templates/404.php
apache - method GET - query  - mark  - uri /cron.php - status 200 - file /var/www/owncloud/cron.php

If anyone could help me to troubleshot this, I would really appreciate.

Thanks for your time


#2

Hey,

i did the following search https://github.com/owncloud/core/search?q=apache+php-fpm&type=Issues and found the following still open issues. When having a look it seems to me that it isn’t recommended or even not working at all to use the combination of ownCloud, Apache and php-fpm.


#3

Hello,

Thanks for your time, I finally made it work with the patch provided in the link you gave ( I already tested it yesterday but it was not a success )

I had to install php locally ( with all the extra libs ) but I still use php-fpm and it respond when I go on my owncloud so I do not understand exactly what is going on.

I would check it again later, thank again.