1

I would need to install / compile apache 2.4 and PHP7 to work together on Centos 6 (specifically on 6.5). I've tried the ius packages, but while apache 2.4 works correctly, it seems that php7 still depends on apache 2.2. By trying to compile php7 by myself, if I configure the build by flagging with --with-apxs2 what I get is a:

Configuring SAPI modules
checking for Apache 2.0 handler-module support via DSO through APXS...

Sorry, I cannot run apxs.  Possible reasons follow:

1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)

but unfortunately I don'see any apxs support by installing httpd24u. Any hints?

Bertuz
  • 125
  • 1
  • 6

1 Answers1

1

PHP 7 is available in the Remi-Repository: http://blog.remirepo.net/post/2015/03/25/PHP-7.0-as-Software-Collection

For Apache 2.4 you can use the Software Collections ( SCL ) Repository https://www.softwarecollections.org/en/scls/rhscl/httpd24/

Wiki Link to SCL: https://wiki.centos.org/AdditionalResources/Repositories/SCL

flxPeters
  • 529
  • 4
  • 5
  • thank you very much! Unfortunately I don't see where Remi-repository installs the php module I should use with SCL's httpd24. It talks about it, but I can't see it at all – Bertuz Apr 19 '16 at 14:43
  • normally you just need php as package and httpd needs the mod_php module loaded. Just try to call a phpinfo() in a php script accesible via apache. This should work – flxPeters Apr 19 '16 at 14:50
  • 3
    the php70 SCL provides mod_php for httpd base package. If you want to use httpd24, then it is simpler to use the FPM service (php70-php-fpm) with a SetHandler directive ( SetHandler "proxy:fcgi://127.0.0.1:9000" ) – Remi Collet Apr 19 '16 at 14:51
  • @RemiCollet thank you: I've installed php70-php-fpm and added the `FilesMatch` directive to my httpd.conf. Unfortunately the php does not seem to be executed: apache returns 200 and my `phpinfo()` page is blank. I have to say that I'm not a fastcgi expert. Any hint? The logs are clean (access log shows my request, but error log is clean) – Bertuz Apr 19 '16 at 15:30
  • I can also say that php-fpm seems to be running correctly, but the filesmatch directive does not seem to be read since apache returns the page with the tags inside – Bertuz Apr 19 '16 at 16:22
  • And I did it! In place of the SetHandler directive you suggested I used this one: ` SetHandler "proxy:fcgi://127.0.0.1:9000" ` something's wrong with the regex I guess – Bertuz Apr 19 '16 at 16:57
  • Strange... cacthing all files seems bad... and \.php$ is what I use.... but if it works.... see http://pkgs.fedoraproject.org/cgit/rpms/php.git/tree/php.conf#n50 – Remi Collet Apr 20 '16 at 07:49