Last active
February 11, 2020 21:59
-
-
Save linuxoracledev/ef4329911f4928220c1d970f3ce3c0bd to your computer and use it in GitHub Desktop.
Install Laravel PHP Framework On Ubuntu 16.04 | 17.10 | 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Update and Upgrade the system | |
sudo apt update | |
sudo apt-get upgrade | |
# Add ppa repository | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
#Install Apache2 | |
sudo apt install apache2 | |
#stop, start and enable Apache2 service | |
sudo systemctl stop apache2.service | |
sudo systemctl start apache2.service | |
sudo systemctl enable apache2.service | |
#Install PHP 7.2 and Related Modules | |
sudo apt install php-mysql php7.2-mysql php7.2-pdo-mysql php7.2-tokenizer php7.2-gd 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 | |
#Open PHP-FPM default file | |
sudo nano /etc/php/7.2/apache2/php.ini | |
#Then make the change the following lines | |
########################### | |
#memory_limit = 256M | |
#upload_max_filesize = 64M | |
#cgi.fix_pathinfo=0 | |
########################## | |
#Install Composer to Download Laravel | |
#curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer | |
cd /tmp | |
curl -sS https://getcomposer.org/installer | sudo php | |
#Move Composer to /usr/local/bin/ directory | |
sudo mv composer.phar /usr/local/bin/composer | |
#Download and install Laravel - MyProject is the project name | |
cd /var/www/html | |
sudo composer create-project laravel/laravel MyProject --prefer-dist | |
#Set the correct permissions for that directory.. | |
sudo chown -R www-data:www-data /var/www/html/MyProject/ | |
sudo chgrp -R www-data /var/www/html/MyProject | |
sudo chmod -R 777 /var/www/html/MyProject/storage/ | |
#Configure Apache2 for Laravel | |
sudo nano /etc/apache2/sites-available/laravel.conf | |
################################################################# | |
#<VirtualHost *:80> | |
# ServerAdmin admin@example.com | |
# DocumentRoot /var/www/html/MyProject/public | |
# ServerName example.com | |
# | |
# <Directory /var/www/html/MyProject/public> | |
# Options +FollowSymlinks | |
# AllowOverride All | |
# Require all granted | |
# </Directory> | |
# | |
# ErrorLog ${APACHE_LOG_DIR}/error.log | |
# CustomLog ${APACHE_LOG_DIR}/access.log combined | |
#</VirtualHost> | |
################################################################ | |
#Enable the Laravel and Rewrite Module | |
sudo a2dissite 000-default.conf | |
sudo a2ensite laravel.conf | |
sudo a2enmod rewrite | |
#Restart Apache2 | |
sudo systemctl restart apache2.service | |
#Access http://example.com |
phpmyadmin
sudo apt install phpmyadmin php-mbstring php-gettext
#Add in php.ini file
sudo nano /etc/php/7.2/apache2/php.ini
extension=php_pdo_mysql.dll
extension=pdo_mysql.so
Include apache.conf in apache conf file
sudo -H gedit /etc/apache2/apache2.conf
#Add this line at the end of the file- Include /etc/phpmyadmin/apache.conf
/etc/init.d/apache2 restart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wallet
sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql -u root -p
CREATE DATABASE wallet DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON wallet.* TO 'uwallet'@'localhost' IDENTIFIED BY 'W@llet';
FLUSH PRIVILEGES;
use wallet
source ~/Desktop/wallet.sql
EXIT;
sudo cp -R wallet/. /var/www/html/MyWallet
sudo nano symlink.php