Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cinco/a4fc526587747c61ab87b1fe3c12357f to your computer and use it in GitHub Desktop.
Save cinco/a4fc526587747c61ab87b1fe3c12357f to your computer and use it in GitHub Desktop.
Prepare Ubuntu 16.04 for Laravel ( PHP + Composer + Valet)

Install PHP (shell)

Requirements

  • Dependencies: sudo apt-get install libnss3-tools jq xsel
  • PHP >= 5.6 : sudo apt-get install php
  • PHP Packages: php*-cli php*-common php*-curl php*-json php*-mbstring php*-mcrypt php*-mysql php*-opcache php*-readline php*-xml php*-zip
  • Optional PHP Packages: php*-sqlite3 php*-mysql php*-pgsql

Install Composer (shell)

There are 2 options to installing composer on Ubuntu.

First option is using official Ubuntu repositories(at this time, it is not the latest option. so you may refer to the second option)

sudo apt-get install composer

Second option, The Composer's way!

Just visit Composer Download Page . Run the 4 lines in order to download the latest version of the composer.

After downloading composer, run this line code to make it global:

mv composer.phar /usr/local/bin/composer

Notice: make sure to logout/login your system after running above line!

Install Valet.

As you may know, Currently there is not any official way to install Valet on Ubuntu. but there is a forked repository prepared for Ubuntu so you can install it on Ubuntu! So to install it, visit Valet Ubuntu and follow the instructions and Your Done!

You can find more information about how to start a project on valet, here

Install laravel-installer

composer global require "laravel/installer"

F.A.Q.

Why can't I run laravel new blog or valet install?

Check that you've added the .composer/vendor/bin directory to your PATH in either ~/.bashrc or ~/.zshrc.

If you use the latest composer version, you may add ./config/composer/vendor/bin directory to your PATH instead of .composer/vendor/bin.

What about the Database?

Well, your choice! You could use the superlight SQLite sqlite3, the extremely versatile MariaDB/MySQL mariadb-server or mysql-server or even the powerful PostgreSQL postgresql. Just don't forget to install the corresponding php package for it.

Any other tips?

Oh yeah! For those looking for a web based simple database managment try Adminer

You can download it here:

And for a beauty theme use this css stylesheet:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment