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. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  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...

7 Responses

  1. Serge Holmberg says:

    Hello
    I have installed MariaDB 10.1.21 and PHP7 from Webtatic . Both works, but when I try to execute php script $connection=mysqli_connect($host,$db_login,$db_password);

    I have an error “PHP Warning: mysqli_connect(): Headers and client library minor version mismatch. Headers:50550 Library:100121”

    I execute php script phpinfo() and got: PHP Version 7.0.14; Client API library version 10.1.21-MariaDB ; Client API header version 5.5.50-MariaDB

    What should I do? Do I need to reinstall MariaDB for version 5.5 or not? Do you have any solution?

  2. 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.

  3. 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

  4. 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. 257,757
  2. 11,967
  3. 39,682

Are you subscribed?