1. Information

2. Installation

Installation of Laravel 5:

  • See https://laravel.com/docs/5.5/installation

  • Install XAMPP.

  • Install Composer.

  • Log in as <user>.

  • Start Terminal.

    composer global require laravel/installer
  • Setup XAMPP to work with Laravel.

  • Edit the php.ini file. (see YouTube video at 16 min).

cd
sudo apt-cache search php7
sudo apt-get install php7.#-mbstring
sudo apt-get install php7.#-xml
sudo apt-get install php7.#-zip
sudo apt-get install tree
composer global require "laravel/installer"
echo PATH=\$PATH:$HOME/.composer/vendor/bin >> $HOME/.bashrc
? echo PATH=\$PATH:$HOME/.composer/vendor/bin >> /etc/bash.bashrc
source $HOME/.bashrc
? source /etc/bash.bashrc
which laravel
laravel --version
laravel new <project>
tree <project>
vdir <project>
cd <project>

php artisan serve
sudo ln -s `pwd`/smru-anc-application/src /var/www/html/anc-app
sudo ln -s $HOME/<project>/public /var/www/html/laravel
sudo /etc/init.d/apache2 restart                # Optional
? sudo chown $USER:$USER $HOME/<project>/storage
? sudo chown -R $USER:$USER $HOME/<project>/storage
? sudo chown $USER:$USER $HOME/<project>/bootstrap/cache
? sudo chown -R $USER:$USER $HOME/<project>/bootstrap/cache
  • Type composer create-project laravel/laravel laravel-5 dev-develop and press Enter.

  • Close Terminal.

3. Installation of Laravel 4

  • Install Composer.

  • Log in as delta.

sudo apt-get install php5-mcrypt
sudo service apache2 restart
sudo composer self-update
mkdir -p ~delta/github/git/delta-software-labs
cd ~delta/github/git/delta-software-labs
composer create-project laravel/laravel ANC-Application --prefer-dist
* .....
cd ~delta/github/git/delta-software-labs/ANC-Application

# Optional.
composer install
composer update


sudo useradd --shell /bin/false --system --uid 900 web
sudo gpasswd -a delta web
sudo gpasswd -a www-data web
sudo chgrp -R web app/storage
sudo chmod -R g+rw app/storage

sudo cp -a /etc/apache2/sites-available/default /etc/apache2/sites-available/laravel
diff /etc/apache2/sites-available/default /etc/apache2/sites-available/laravel

+

0a1,2
> Alias /ANC-Application /home/delta/github/git/delta-software-labs/ANC-Application/public
>
2a5,6
>       ServerName laravel
>       ServerAlias www.laravel
4c8
<       DocumentRoot /var/www
---
>       DocumentRoot /home/delta/github/git/delta-software-labs/ANC-Application/public

+

sudo a2ensite laravel
sudo service apache2 restart
  • Append the following lines to the /etc/hosts file?

    #Virtual Hosts
    12.34.56.789    example.com
  • Note: Clashes with other web sites.

  • Contents of the /etc/apache2/conf.d/laravel.conf file.

    Alias /ANC-Application "/home/delta/github/git/delta-software-labs/ANC-Application/public"
    
    <VirtualHost *:80>
      # Host that will serve this project.
      ServerName app.dev
      # The location of our projects public directory.
      DocumentRoot /home/delta/github/git/delta-software-labs/ANC-Application/public
      # Useful logs for debug.
      CustomLog /var/log/apache2/laravel-access.log common
      ErrorLog /var/log/apache2/laravel-error.log
      # Rewrites for pretty URLs, better not to rely on .htaccess.
      <Directory /home/delta/github/git/delta-software-labs/ANC-Application/public>
        <IfModule mod_rewrite.c>
          Options -MultiViews
          RewriteEngine On
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteRule ^ index.php [L]
        </IfModule>
      </Directory>
    </VirtualHost>
    ? sudo a2enmod rewrite
    sudo service apache2 restart

4. Configuration of Laravel 4

  • Log in as user.

    sudo cp -a app/config/app.php app/config/app.php.orig
    sudo cp -a app/config/database.php app/config/database.php.orig
    # Set the timezone value in the application.php file to 'Asia/Bangkok'.
    sudo php artisan key:generate
  • Make the following changes to the database.php file.

    'default' => 'pgsql',
    
    'pgsql' => array(
            'driver'   => 'pgsql',
            'host'     => '127.0.0.1',
            'host'     => 'localhost,
            'database' => 'laravel',
            'username' => 'delta',
            'password' => '********',
            'charset'  => 'utf8',
            'prefix'   => '',
            'schema'   => 'public',
    ),
  • Close Terminal.

git clone https://github.com/laravel/laravel.git ANC-Application
cd ANC-Application
composer install
# Use built-in server of PHP 5.4:
php -v
php -S localhost:8888 -t public
  • Download the latest development version from http://four.laravel.com.

    cd /opt
    sudo unzip ~/Downloads/laravel-develop.zip
    sudo rm -rf laravel
    sudo ln -s laravel-develop laravel
    sudo ln -s /opt/laravel/public /var/www/laravel
    vdir
    cd /opt/laravel
    ? Type [kbd]`sudo chown -R www-data:www-data app/storage/*
    sudo composer install
    sudo cp -a app/config/app.php app/config/app.php.orig
    sudo cp -a app/config/database.php app/config/database.php.orig
    
    # Set the timezone value in the application.php file to 'Asia/Bangkok'.
    sudo php artisan key:generate
  • Make the following changes to the database.php file.

    'default' => 'pgsql',
    
    'pgsql' => array(
            'driver'   => 'pgsql',
            'host'     => '127.0.0.1',
            'database' => 'laravel',
            'username' => 'delta',
            'password' => '********',
            'charset'  => 'utf8',
            'prefix'   => '',
            'schema'   => 'public',
    ),
  • Browse to http://localhost/laravel.

5. Installation of Laravel 3

  • Log in as user.

  • Download the latest stable version from laravel.com.

    sudo apt-get install php5-mcrypt
    sudo service apache2 restart
    cd /opt
    sudo unzip ~/Downloads/laravel-laravel-v3.2.13-5-g23d23dd.zip
    sudo find laravel-laravel-23d23dd -type d -exec chmod a+rx {} \;
    sudo rm -rf laravel
    sudo ln -s laravel-laravel-23d23dd laravel
    sudo ln -s /opt/laravel/public /var/www/laravel
    vdir
    cd /opt/laravel
    sudo chown -R www-data:www-data storage/views
    cd /opt/laravel/application/config
    sudo cp -a application.php application.php.orig
    sudo cp -a database.php database.php.orig
    # Set the timezone value in the application.php file to 'Asia/Bangkok'.
    # Set the key value in the application.php file to an empty string.
    cd /opt/laravel
    sudo php artisan key:generate
  • Make the following changes to the database.php file.

    'default' => 'pgsql',
    
    'pgsql' => array(
            'driver'   => 'pgsql',
            'host'     => '127.0.0.1',
            'database' => 'laravel',
            'username' => 'delta',
            'password' => '********',
            'charset'  => 'utf8',
            'prefix'   => '',
            'schema'   => 'public',
    ),
  • Browse to http://localhost/laravel.

6. Experimental

  • Install Composer.

  • Log in as user.

  • Download the latest validation version from https://github.com/illuminate/validation.

    cd /opt
    sudo unzip ~/Downloads/validation-master.zip
    cd validation-master
    sudo composer install

Production way, moderate complexity for people not familiar with unixes, but more secure:

Go in super user mode (sudo -s or su).
Create group web (groupadd web)
Add you main user to group web (suppose your user is cool_user, so run usermod -a -G web cool_user)
Add php-fpm or web server user (is php used as SAPI module) to web group (for example, on centos php-fpm utilize apache user name, so in most cases this will work: usermod -a -G web apache)
Change your project root directory group owner to web recursively (chgroup -R web /path/to/project/root/)
Grant recursively write permission for group (chmod -R g+w /path/to/project/root/
Optionaly To allow all newly created by apace (or some other) user files and folders be accessible from your user, make them receive group ownership same as their parent folder by setting groupid bit recursively on your project root directory (chmod -R g+s /path/to/project/root/).

Voila!.