How to Install PHP 7 with Apache and MariaDB on CentOS 7/Debian 8

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

6 Responses

  1. Artyom says:

    1. php5 uninstall first?
    2. -with open-ssl not works, I have compiled without that
    3. /usr/lib64/httpd/modules/libphp7.so not existing directory and file.
    Result: Job for apache2.service failed.

    • @Artyom,
      1) Yes, it is recommended that you uninstall previous versions of PHP present on your system.
      2) Have you install mod_ssl? It should work if you did.
      3) Have you tried searching for that *.so file elsewhere on the system?

    • Sander Swuste says:

      3. Did you use the –with-apxs2 option? If you skip this option the .so will not be created.

  2. Gelo says:

    Hello I’m a new Linux user and have not been able to locate the HTTPD.conf file to add the following code. I’m still in the learning process, a command line structure to add this from the terminal, will be greatly appreciated. Thank you,

    LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so

    SetHandler application/x-httpd-php

  3. Xiao Guoan says:

    When I execute sudo make install command, it outputs the following error.

    Installing PEAR environment: /usr/lib/php/

    Warning: fopen(): SSL operation failed with code 1. OpenSSL Error messages:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /home/bumper/php-src/pear/fetch.php on line 66

    Warning: fopen(): Failed to enable crypto in /home/bumper/php-src/pear/fetch.php on line 66

    Warning: fopen(https://pear.php.net/install-pear-nozlib.phar): failed to open stream: operation failed in /home/bumper/php-src/pear/fetch.php on line 66

    Error..
    fopen(https://pear.php.net/install-pear-nozlib.phar): failed to open stream: operation failed
    make: *** [install-pear] Error 1

    So what could be the problem? Thank you.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?