Skip to content

Instantly share code, notes, and snippets.

@zicodhkbd
Created November 1, 2019 18:14
Show Gist options
  • Save zicodhkbd/c897138e0f8cc54b434f02ac55300f00 to your computer and use it in GitHub Desktop.
Save zicodhkbd/c897138e0f8cc54b434f02ac55300f00 to your computer and use it in GitHub Desktop.
Laravel PHP Framework On Ubuntu 18.04
#!/bin/sh
sudo apt update
sudo apt install apache2
sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
sudo apt install php7.2 libapache2-mod-php7.2 php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-cli php7.2-zip
sudo nano /etc/php/7.2/apache2/php.ini
memory_limit = 256M
upload_max_filesize = 64M
cgi.fix_pathinfo=0
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
cd /var/www/html
sudo composer create-project laravel/laravel TestProject --prefer-dist
sudo chown -R www-data:www-data /var/www/html/TestProject/
sudo chmod -R 755 /var/www/html/TestProject/
sudo nano /etc/apache2/sites-available/laravel.conf
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/html/TestProject/public
ServerName localhost
<Directory /var/www/html/TestProject/public>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite laravel.conf
sudo a2enmod rewrite
sudo systemctl restart apache2.service
http://localhost/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment