Easiest way to install LAMP On Ubuntu
For a beginner its really a difficult to install LAMP on Ubuntu. Even if it is installed its very difficult to run phpmyadmin properly.
I am going to share my personal experience and difficulties we may encounter during installation.
First of all we are going to install apache, php, mysql and phpmyadmin
A) Installing Apache
B) Installing Php
C) Installing Mysql
D) Installing Phpmyadmin
A) Installing Apache
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. The Terminal might ask you for your password, type your password and then press enter.
3. Testing: Run http://localhost/ url in your browser. If you get a message “It works!” then Apache is sucessfully installed.
B) Installing Php
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. The Terminal might ask you for your password, type your password and then press enter.
3. Restart apache by runing this code to make Php compatible with Apache.
4. Testing PHP
i. In the terminal copy/paste the following line:
ii. Copy and Paste following line code into the testingphp file:
iii. Save the file.
iv. Run http://localhost/testingphp.php in your browser. If it displays ‘Hello World!!!’ then PHP is alswo sucessfully installed.
C) Installing Mysql
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. If you need to give access to the server you have created for others computer in your network you must edit the my.cnf file.
Modify the line
to
Change 127.0.0.1 to your IP address (eg 192.168.0.1)
(Note you can skip this step)
3. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
If you get Following error message
COMMAND:mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘yourpassword’);
ERROR:mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘yourpassword’);”
then run
4. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
Add the following line of code inside apache2.conf file:
and restart Apache:
5. Now copy and paste this line in your terminal:
Note: You can change password of your choice. But if you wish to work without your password then you should modify /etc/phpmyadmin/config.inc.php file
i. Run the following code in your terminal
2. Change
line to
D. Installing Phpmyadmin
1. Open up the Terminal (Applications > Accessories > Terminal) and run the following line of code:
2. Edit php.ini file by running following code in your terminal
Change
to
If you dont find ;extension=mysql.so then skip it uncomment other mysql lines eg.
3. Run following code in your terminal to restart apache
4. Testing: Run http://localhost/phpmyadmin in your browser if you get window of phpmyadmin then you might be asked with username and password.
Username: root
Password: (If you had set password from step C.5. then enter that password or leave it empty)
If you get login then congrats. Now you have got installed all Apache, PHP, Mysql and Phpmyadmin.
Recent Comments