Manjaro Linux – Install Apache, PHP, MariaDB – MySQL (LAMP)

To install “LAMP” – Apache, PHP, MySQL on Arch and Manjaro Linux do some steps:

First update Your operating system to latest version:

sudo pacman -Syyu

Apache

After updating Your system lets install Apache web server:

sudo pacman -S apache

Edit file /etc/httpd/conf/httpd.conf, search and comment the following line:
# LoadModule unique_id_module modules/mod_unique_id.so

sudo nano /etc/httpd/conf/httpd.conf

Enable Apache service and restart Apache service using commands:

sudo systemctl enable httpd
sudo systemctl restart httpd

Verify Apache status by command:

sudo systemctl status httpd

PHP

Now install latest version of PHP:

sudo pacman -S php php-apache

After installation we neet to configure out PHP.
Edit file: /etc/httpd/conf/httpd.conf

sudo nano /etc/httpd/conf/httpd.conf

Find the folowing line and comment it:

#LoadModule mpm_event_module modules/mod_mpm_event.so

Also uncomment or add the line:

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

Then add the following lines at the bottom of configuration file:

LoadModule php7_module modules/libphp7.so
AddHandler php7-script php
Include conf/extra/php7_module.conf

PHP installed. Now create index.php file in Apache home directory to check that PHP is installed correctly:

sudo nano /srv/http/index.php
<?php
phpinfo();
?>

Restart the PHP service:

sudo systemctl restart httpd

Go to http://127.0.0.1/ and check that Apache server with latest PHP version installed on your Manjaro Linux:

MySQL MariaDB

Install MySQL Server:

sudo pacman -S mysql

Initialize the MariaDB data directory prior to starting the service:

sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql

Enable and srart MySQL service:

sudo systemctl enable mysqld 
sudo systemctl start mysqld

Check that MySQL service installed and work correctly:

sudo systemctl status mysqld

After installation MySQL You need to setup root user and password:

sudo mysql_secure_installation

13 thoughts on “Manjaro Linux – Install Apache, PHP, MariaDB – MySQL (LAMP)”

  1. I just now wanted to thank you once more for this amazing web site
    you have made here. It truly is full of ideas for those
    who are truly interested in this particular subject, particularly this very post.
    You’re really all so sweet along with thoughtful of others in addition to the fact that reading your
    website posts is a fantastic delight to me. And exactly what a generous
    treat! Jeff and I will have pleasure making use of your guidelines in what we need to do
    in a few days. Our collection of ideas is a distance long and tips will
    certainly be put to very good use.

  2. You are so awesome! I don’t believe I have read something
    like that before. So nice to discover another person with some
    original thoughts on this issue. Really..
    thanks for starting this up. This website is one thing that
    is required on the web, someone with a bit of originality!

  3. It is the best time to make a few plans for the future and
    it’s time to be happy. I have read this submit and if
    I may I desire to recommend you some interesting issues or suggestions.
    Maybe you can write subsequent articles relating to this article.
    I wish to learn even more issues approximately it!

  4. What’s Taking place i am new to this, I stumbled upon this I
    have discovered It absolutely helpful and it has helped me out loads.
    I’m hoping to contribute & help other customers like its helped
    me. Good job.

  5. My brother suggested I might like this blog.
    He was entirely right. This post truly made my day.
    You cann’t imagine simply how much time I had spent for this information! Thanks!

  6. This is very interesting, You are a very skilled blogger.
    I’ve joined your rss feed and look forward to seeking more of your magnificent post.
    Also, I’ve shared your web site in my social networks!

  7. I am regular reader, how are you everybody? This article posted at this website is really good.

  8. I must thank you for the efforts you’ve put in penning this site.
    I am hoping to check out the same high-grade blog posts from you later
    on as well. In truth, your creative writing abilities has encouraged me to
    get my very own site now 😉

  9. Hey there would you mind sharing which blog platform you’re working with?

    I’m looking to start my own blog soon but I’m having
    a difficult time choosing between BlogEngine/Wordpress/B2evolution and
    Drupal. The reason I ask is because your design seems different then most blogs and I’m looking for something completely unique.
    P.S My apologies for being off-topic but I had to ask!

  10. Does your website have a contact page? I’m having a tough time locating it but, I’d like to send
    you an email. I’ve got some suggestions for your blog you might be
    interested in hearing. Either way, great blog and I look forward to seeing it improve over time.

  11. Usually I do not read post on blogs, however I wish to
    say that this write-up very forced me to check out and do
    it! Your writing taste has been surprised me.
    Thank you, very nice post.

  12. Very great post. I simply stumbled upon your weblog and wanted to say that I have really loved browsing
    your weblog posts. In any case I’ll be subscribing for your feed and I am hoping you write once
    more very soon!

Comments are closed.