Linux + Apache + MySql + PHP + Laravel

Update and Upgrade Ubuntu

$ sudo apt-get update
$ sudo apt-get upgrade

Start out with the basics – Apache, MySQL and PHP + extensions

$ sudo apt-get install mysql-server mysql-client apache2 php5 php5-cli
libapache2-mod-php5 php5-mysql php5-curl php5-gd php-pear php5-
imagick php5-mcrypt php5-memcache php5-mhash php5-sqlite php5-xmlrpc
php5-xsl php5-json php5-dev libpcre3-dev

Download Composer

$ sudo curl -s$ | php

Install Laravel

$ sudo php composer.phar global require "laravel/laravel"
change directory to directory for laravel project

$ cd /var/www/html
$ sudo php ~/composer.phar create-project --prefer-dist laravel/laravel ProjectName

To give permision for server to access folder, then execute below command on terminal :

$ sudo chown -R www-data:www-data /var/www/html
$ sudo chown -R www-data:www-data /var/www/html/ProjectName/storage
$ sudo chown -R www-data:www-data /var/www/html/ProjectName/vendor

This error might happen :
500 internal server error

To fix this error change directory to project directory. Execute below command on terminal:

$ cd /var/www/html/
sudo chmod 755 -R ProjectName
$ sudo chmod -R o+w ProjectName/storage

Afterward your project can be open at https://yourlocalhost/ProjectName/public

Unfortunately to make Laravel really function for routing we need to make virtualhost for laravel. I will update later.

Reference :
Tiada ulasan

Tiada ulasan :

Catat Ulasan