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?

  • Why doesn't CentOS just release PHP7 in Yum?
    – Chloe
    Feb 16 '18 at 1:38

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

  • 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 (<FilesMatch \.php$> SetHandler "proxy:fcgi://" </FilesMatch>) 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 <?php ?> tags inside
    – Bertuz
    Apr 19 '16 at 16:22

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.