Saturday 19 September 2015

Install XAMPP + Laravel in Ubuntu

Hello,

Ubuntu version: 14.04.3 LTS
XAMPP version: 5.6.15
Laravel version: 5.2

Install XAMPP (as root)
  • chmod +x xampp-linux-x64-5.6.12-0-installer.run
  • ./xampp-linux-x64-5.6.8-0-installer.run
  • You will be asked to answer some questions, I sayed always Y.
  • To start lampp server: /opt/lampp/lampp start
Install Laravel (as root)
  • Install composer: curl -sS https://getcomposer.org/installer | /opt/lampp/bin/php -- --install-dir=/opt/lampp/bin --filename=composer
  • cd /opt/lampp/htdocs
  • export PATH="$PATH:$HOME/.composer/vendor/bin"
  • export PATH=$PATH:/opt/lampp/bin
  • composer global require "laravel/installer"
  • laravel new test
  • chmod 777 /opt/lampp/htdocs/test/bootstrap/cache
  • chmod -R 777 /opt/lampp/htdocs/test/storage/*
Config Virtual Hosts (as root)
  • vim /opt/lampp/etc/httpd.conf
  • #Include etc/extra/httpd-vhosts.conf --> Include etc/extra/httpd-vhosts.conf
  • Add in /opt/lampp/etc/extra/httpd-vhosts.conf
    •  <VirtualHost *:80>
          ServerAdmin webmaster@dummy-host.example.com
          DocumentRoot "/opt/lampp/htdocs/test/public"
          ServerName testlaravel.com
          ServerAlias www.testlaravel.com
          ErrorLog "logs/testlaravel-error_log"
          CustomLog "logs/testlaravel-access_log" common
      </VirtualHost>
  • /opt/lampp/lampp restart
  • Add in  /etc/hosts
    • 127.0.0.1       testlaravel.com
    • 127.0.0.1       www.testlaravel.com
Done! Go to your browser and write: testlaravel.com...