Users who are new in Linux(Ubuntu)Open up the Terminal (Application->Accessories->Terminal) and type (or copy paste)
sudo su rootWith the help of above command you can switch from normal user to root. Now by next time you don't need to use commands with "sudo". Instead of using sudo you can directly use commands who needs privilege for example :
If you are installing apache on your system then use simply "apt-get install apache2" instead of "sudo apt-get install apache2".
STEP 1 : INSTALLING APACHE WEB SERVER
apt-get install apache2
STEP 2 : INSTALLING PHP
apt-get install php5 libapache2-mod-php5Type the following code in Terminal to restart Apache.
STEP 3 : INSTALLING MYSQLNow type following command in your amazing terminal to install Mysql Server
apt-get install mysql-serverDuring the installation please provide username and password for Mysql server .After giving the all required mysql server is now installed on the machine.
STEP 4 : INSTALLING phpMyAdminphpMyAdmin provides web interface for Mysql through which you can update your database easily. Copy/paste the following line into Terminal:
apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
- After that is installed our next task is to get PHP to work with MySQL. To do this we will need to open a file entitled php.ini. To open it type the following:
gedit /etc/php5/apache2/php.iniNow we are going to have to uncomment the following line by taking out the semicolon (;).
Change this line:
;extension=mysql.so //to look like this extension=mysql.so
- After that need to execute this command below for changing phpMyadmin folder to var/www
ln -s /usr/share/phpmyadmin/ /var/www/phpmyadmin
- Now just restart Apache and you are all set!
STEP 5 : TEST Apache/ PHP
- In the terminal copy/paste the following line:
- Copy/Paste following line into the testphp.php file: Save and close the file.
- Now open you're web browser and type the following into the web address:
- You have now installed both Apache and PHP well !!!
STEP 6 : TEST MySql
- Open the terminal and write the following command:
mysql -u root -p[password]
- Now you will be in the mysql server comand prompt. So mysql server also works well !!!
STEP 7 : TEST phpMyAdmin
- Open you're web browser and type the following into the web address:
- You will get the login window, now use the same user and password which you have configured for mysql server.
- You will be now in home page of phpmyadmin. So phpmyadmin also works well !!!
STEP 8 : START/ STOP/ RESTART (apache, mysql)
/etc/init.d/mysql start /etc/init.d/mysql stop /etc/init.d/mysql restart /etc/init.d/apache2 start /etc/init.d/apache2 stop /etc/init.d/apache2 restart
To enable apache rewrite modules
sudo a2enmod rewrite
To enable curl
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl sudo gedit /etc/apache2/stites-available/defaultmake override "All"