Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Faizanq/35647a194703e1edf4512f7c8b753c30 to your computer and use it in GitHub Desktop.
Save Faizanq/35647a194703e1edf4512f7c8b753c30 to your computer and use it in GitHub Desktop.
##Install Apache, MySQL, PHP on Linux generally called LAMP which needs to install together to host websites and dynamic web applications on server. Where Linux is operating system, Apache is web server, MySQL is database and content is processed with PHP scripting language.
sudo apt-get update
sudo apt-get install apache2
##Enable Required apache2 modes
sudo a2enmod headers proxy_http xml2enc proxy ssl proxy_wstunnel rewrite
Note: rewrite // this mode is to enable htaccess
`for .htaccess to work enabled mode rewrite`
sudo nano /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All //------ this will be none and should be All
Require all granted
</Directory>
Install PHP 7.2
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2
sudo apt-cache search php7.2-*
sudo apt-get install php7.2-fpm
sudo apt-get install php7.2-mbstring php7.2-curl php7.2-json php7.2-xml php7.2-mysql php7.2-zip
sudo apt-get install php-pear php7.2-dev
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.2-fpm
sudo apt-get install libapache2-mod-php7.2
pear config-set php_ini /etc/php/7.2/apache2/php.ini
pecl config-set php_ini /etc/php/7.2/apache2/php.ini
##Install MySQL phpMyAdmin
sudo apt-get install mysql-server mysql-client
sudo apt-get install phpmyadmin
Please add respective password of root user when asked in terminal for mysql root user.
Check the Server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment