Step 1: Install Apache

To install apache, open terminal and type in these commands:

sudo apt-get update
sudo apt-get install apache2
That’s it. To check if Apache is installed, direct your browser to your server’s IP address (eg. http://12.34.56.789). The page should display the words “It works!" .

Step 2: Install MySQL

To install MySQL, open terminal and type in these commands:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

Step 3: Install PHP

To install PHP, open terminal and type in this command.

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
It may also be useful to add php to the directory index, to serve the relevant php index files:

sudo nano /etc/apache2/mods-enabled/dir.conf
Add index.php to the beginning of index files. The page should now look like this:

<IfModule mod_dir.c>

DirectoryIndex index.php index.html index.cgi index.pl index.php index.xhtml index.htm

</IfModule>

Step 4: RESULTS — See PHP on your Server

To set this up, first create a new file:

sudo nano /var/www/info.php
Add in the following line:

<?php phpinfo(); ?>

Then Save and Exit.

Restart apache so that all of the changes take effect:

sudo service apache2 restart
Finish up by visiting your php info page (make sure you replace the example ip address with your correct one): http://12.34.56.789/info.php



Step 5: Install phpMyAdmin

To install phpMyAdmin, open terminal and type in these commands:

sudo apt-get update
sudo apt-get install phpmyadmin
 منبع : problems-pb - problems-pb
دوشنبه 01 شهریور 1395 ساعت 18:10:05
  برچسب ها : install ,index ,sudo ,mysql ,your ,step ,open terminal ,commands sudo ,these commands ,install phpmyadmin ,sudo nano