Cara Install Laravel 5.7 di Linux

Sebelumnya pastikan webserver dan PHP sudah terinstall dan berjalan dengan baik.

Selanjutnya install Composer(dependency manager PHP)

#curl -sS https://getcomposer.org/installer | php
#mv composer.phar /usr/local/bin/composer
#chmod +x /usr/local/bin/composer
#cd /var/www/html/
#sudo composer create-project --prefer-dist laravel/laravel dashboard
#cd dashboard
#php artisan key:generate


#chown -R www-data.www-data /var/www/html/dashboard
#chmod -R 755 /var/www/html/dashboard
#chmod -R 777 /var/www/html/dashboard/storage


Selanjutnya konfigurasi database yang akan digunakan oleh aplikasi Laravel

#mysql -u root -p
mysql> CREATE DATABASE dashboard;
mysql> GRANT ALL ON laravel.* to 'laravel'@'localhost' IDENTIFIED BY 'Skill39';
mysql> FLUSH PRIVILEGES;
mysql> quit

Buka file .env di direktori laravel, sesuaikan seperti berikut:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=dashboard
DB_USERNAME=laravel
DB_PASSWORD=Skill39


Konfigurasi apache untuk laravel

#nano /etc/apache2/sites-enabled/000-default.conf

Edit

DocumentRoot /var/www/html/dashboard/public


#service apache2 restart


Referensi:
https://laravel.com/docs/5.7/installation
https://www.tecmint.com/install-laravel-php-framework-on-ubuntu/
https://www.tecmint.com/install-laravel-in-centos/

Komentar

Postingan populer dari blog ini

Pembahasan IT Network Systems Administration Module A DNS (Forward Zone, Reverse Zone, CNAME, MX, Split View)

Cara restart / stop windows service (services.msc) dengan bat / cmd

How to convert VMDK to OVA