Install Apache MySQL PHP and phpMyAdmin Arch Linux

Install Apache MySQL PHP and PHPmyadmin Arch Linux is always a pain for some people.In this tutorial, i am going to give you a full outline to do all of them.
Apache Installation
Apache is the most widely user webserver over 50% of total world servers.
Ok.Let’s start the installation.

$ sudo pacman -S apache
$ sudo systemctl start httpd
$ sudo systemctl status httpd

To Test Go to

http://your_server_IP_address or 127.0.0.1

If you can see the default Apache Webpage, installation is success.

Note: The default apache document folder is located in /srv/http
You can put HTML files inside it and test server.
To test just goto http://127.0.0.1/file_name.html

Since, PHP is not installed, at this point PHP files will not execute.

Install MySQL

$ sudo pacman -S mysql
$ sudo systemctl start mysqld
$ sudo systemctl status mysqld
$ sudo mysql_secure_installation

The command prompt will ask for passwords. Set your own passwords here.

To login to MySQL command prompt use:

mysql -u root -p

Where -u username -p , Now enter the password you have set in the previous step.

PHP Installation

$ sudo pacman -S php php-apache

To test php is working, create a php file in the apache’s root folder (ie. /srv/http),
create a file name info.php and paste the following code:

<? php phpinfo(); ?>

You can execute this php script using:

http://your_server_IP_address/info.php or http://127.0.0.1/info.php

If success, it will show a page with default informations about php.
The info() function will give you information about your server.

Note:
To enable phpMyAdmin internal authentication, Uncomment the following lines from the /etc/php/php.ini file

extension=mysqli.so
extension=mcrypt.so

Then, restart server

If php cannot access any folder just add the folder path to /etc/php/php.ini file like this:

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/folder/subfolder

Apache Commands in Arch Linux

Restart Apache Web server

sudo systemctl restart httpd

Stop Apache Web server

sudo systemctl stop httpd

Start Apache Web server

sudo systemctl start httpd

Find Status of Webserver

sudo systemctl status httpd

phpMyAdmin

$ sudo pacman -S phpmyadmin php-mcrypt

After installing phpMyAdmin

include th configuration in the /etc/httpd/conf/httpd.conf file.To do that,

sudo gedit  /etc/httpd/conf/httpd.conf

And add below line in the file:

# phpMyAdmin configuration
Include conf/extra/phpmyadmin.conf

Last step, restart your webserver to load the new configurations.

sudo systemctl restart httpd

To goto phpMyAdmin

http://your_address/phpmyadmin or http://127.0.0.1/phpmyadmin

Information about Git,SSH and many more can be found at: www.preprogrammer.com

Install Apache MySQL PHP and phpMyAdmin Arch Linux on Debian/Ubuntu/Mint : Install Apache MySQL PHP and phpMyAdmin on Debian/Ubuntu/Mint