Install localhost in ubuntu [with phpmyadmin, mysql, apache2]

To day I install and I fixed a problem of "Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
". So we start:

1- install Apache:

sudo apt-get install apache2 

2- install Mysql server:

sudo apt-get install mysql-server 

If ask you about add new password, add "root", and confirm by "root" again.
3- Restart Server:

sudo /etc/init.d/apache2 restart 
4- Test the server:

If you get page like this, all things is good :D

5-Install phpmyadmin:

sudo apt-get install phpmyadmin php-mbstring php-gettext

- For the server selection, choose apache2.
- when ask you to use "dbconfig-common to set up the database" select Yes 
- The password is the pass you add in the part of mysql-server, and if follow me is "root".

 5-Enable the PHP mcrypt and mbtring extensions:

sudo phpenmod mcrypt
sudo phpenmod mbstring

6- Restart Server:

sudo /etc/init.d/apache2 restart

7- Configure phpmyadmin with the Apache server:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin

8- Restart Server:

sudo /etc/init.d/apache2 restart 

9- Test the server with phpmyadmin:

If you get page like this, all things is fine:

10- Add your php files in the localhost:

If you need add your file or website or install wordpress, open the localhost folder us a root by this:

 sudo gksu nautilus /var/www/html

And put your file in the folder of HTML, (note: don't remove phpmyadmin folder).

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel