Setting Up LAMP (Linux, Apache, MariaDB and PHP) on Fedora 24 Server

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

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.45/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.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

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

24 Responses

  1. xavico says:

    Thanks for this. I’ve just finish install LAMP. Thanks so much.

  2. Ropoja says:

    Nice post, it really helped me!

  3. Chi Fook says:

    on Fedora 25 Server, package php-mysql is not available, so the command :

    # dnf install php-mysql

    won’t work and it should replace with :

    # dnf install php-mysqlnd

  4. Wolfgang says:

    Thanks for the information!
    However, I had to use “systemctl start mariadb” instead of “systemctl start mariadb-service”.
    See also:

    • Ravi Saive says:


      Yes, you right, the correct command should be like this:

      # systemctl start mariadb.service
      # systemctl status mariadb.service

      Corrected in the writeup..

  5. Bobby says:

    The dash in this command # dnf install mariadb-server should be replaced with a dot.

    # dnf install mariadb.server

  6. Mojtaba says:


    I did everything as said step by step. the site works fine, but the login page and the dashboard are a mess. could you please help me.

  7. Victor Parlindungan says:

    I’ve just finish installing LAMP with your tutorial. Everything working fine, except the php. The php is not being executed. I try adding semicolon after the braces, but not executed too.

    Note :
    Fedora 24 on vmware

    • Ravi Saive says:


      How you executing PHP command? could you share with us and also could you run the following command to confirm that the php installed correctly..

      # php -v
    • Aaron Kili K says:


      Try to install libapache2-mod-php5, apache2’s module to work with php as follows and then test php again:

      sudo dnf install libapache2-mod-php5

  8. Richard says:

    How would I connect Apache and MariaDB together if they were on separate VMs? Lets say I installed Apache on one VM and then MariaDB on another VM, how would they work together?

    • Ravi Saive says:


      On the Apache Serer, just add the MariaDB settings like username, password, database name and server IP address (IP Address of MariaDB) in the Apache application configuration file may be in config.php for something like this..

  9. Mark says:

    Thanks for this. Very helpful! One type though: “systemctl enable mariadb-service ” et. seq should be “systemctl enable mariadb.service”

    Great! Thanks again.

  10. Barry Schofield says:

    how do I make it bootup apache when I switch on using Fedora 24?

    • Ravi Saive says:


      You can enable Apache to start at Fedora 24 startup using below command.

      # systemctl enable httpd.service

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.