Install Apache, PHP, Mysql on Ubuntu

  • sudo apt-get update
  • sudo apt-get install apache2

Restart Apache 
  • sudo systemctl restart apache2

Step 2: Install MySQL


sudo apt-get install mysql-server

Step 3: Install PHP

PHP is the component of our setup that will process code to display dynamic content. It can run scripts, connect to our MySQL databases to get information, and hand the processed content over to our web server to display.
We can once again leverage the apt system to install our components. We're going to include some helper packages as well, so that PHP code can run under the Apache server and talk to our MySQL database:
  • sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
This should install PHP without any problems. We'll test this in a moment.

Step 4: Symbolic Link (Symlink)

  • sudo ln -s  /home/shilan/public_html /var/www/html
  • sudo nano /etc/apache2/sites-enabled/000-default.conf
Change
 DocumentRoot /var/www/html/public_html

and restart apache server


Comments

Popular Posts