in Code name: Ant-man, Laravel, Software Development

There are quite a number of components needed to setup a proper Laravel development environment on Xubuntu. And, I am tired of Googling around for each and every components. Hence, the birth of this article for my own reference. Use it at your own risk although your computer won’t explode 🙂

First, install the fundamental components, such as git and curl

$ sudo apt install git curl

Then, install the mighty package management system for PHP – composer. Initially, I was planning to install PHP CLI manually then install composer as per the instructions from the website. But then this is not necessary anymore! Just simply type in the following commands will do:-

$ sudo apt install composer

* The above will install PHP CLI 7.2.7 automatically as well

Still need a few more items to complement PHP for composer.

$ sudo apt install php-mbstring php-xml php-zip php-intl php-soap php-mysql php-curl php-gd php-bcmath php-xdebug
$ sudo apt install php7.2-mbstring php7.2-xml php7.2-zip php7.2-intl php7.2-soap php7.2-mysql php7.2-curl php7.2-gd php7.2-bcmath php7.2-dev

Next, install XAMPP by going to to download the latest XAMPP for Linux 7.2.7 (64-bit).

$ chmod 755
$ sudo ./

And then, just click “Next” on the screens pop-up and your XAMPP will be installed into /opt/lampp.

There are 2 ways to start/stop the XAMPP services:-

  1. Via command line
    $ sudo /opt/lampp/lampp start
    $ sudo /opt/lampp/lampp stop
  2. Via graphical tool
    $ cd /opt/lampp/
    $ sudo ./

You should be able to see the following page by now when you launch your favorite browser.

Next, I will install PhpStorm because I need a full IDE

$ sudo snap install phpstorm --classic

Finally, we arrived at the Laravel portion.

But, we will face permission issue when we try to deploy Laravel projects into the /opt/lampp/htdocs folder/directory.

We need to change the ownership for /opt/lampp/htdocs folder/directory

$ sudo chown -R [Username]:[Group Name] /opt/lampp/htdocs

Replace the [Username] and [Group Name] with your own account.

Then, edit the Apache configuration file at /opt/lampp/etc/httpd.conf and look for the “User daemon” line

Again, replace the [Username] and [Group Name] with your own account.

Restart all XAMPP services and you are done!

    • Setup *.test for local development
    • Generate self-signed certificate
      • mkdir /opt/lampp/apache2/crt

      • openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /opt/lampp/apache2/crt/test.key -out /opt/lampp/apache2/crt/test.crt

      • Edit httpd-vhosts.conf

        <VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot “/opt/lampp/htdocs/yubin”
        ServerName yubin.test
        ErrorLog “logs/yubin.test-error_log”
        CustomLog “logs/yubin.test-access_log” common
        <VirtualHost *:443>
        ServerAdmin [email protected]
        DocumentRoot “/opt/lampp/htdocs/yubin”
        ServerName yubin.test
        ErrorLog “logs/yubin.test-error_log”
        CustomLog “logs/yubin.test-access_log” common
        SSLEngine on
        SSLCertificateFile “/opt/lampp/apache2/crt/test.crt”
        SSLCertificateKeyFile “/opt/lampp/apache2/crt/test.key”

    • Install XDebug for XAMPP
      • Option 1
        • sudo pear channel-update
        • sudo pecl channel-update
        • sudo pecl install xdebug
        • sudo vim /opt/lampp/etc/php.ini

          xdebug.remote_autostart = 1

        • sudo /opt/lampp/lampp restart
      • Option 2 (for PHP 7.3 and applicable for others)
    • Install multiple PHP (refence:
      • sudo add-apt-repository ppa:ondrej/php
      • sudo apt-get update
      • sudo apt install php7.0-cli



Write a Comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.