Linux
Setting up a linux development machine
The following instructions will work on Ubuntu or closely related distros like Pop OS. They will also mostly work on Debian-based distros with some slight tweaks.
Install Visual Studio Code
- Download from software store or from vs code website
- Install the Settings Sync extension
- Ask a member of the dev team to upload their settings as a public gist
- Press Shift + Alt + D
- From the menu that appears, click ‘download public gist’
- Enter the gist ID given to you by the dev team member
- Wait for all settings and extensions to be installed
Install required tools, packages and languages
PHP
Curl
Composer
To install Composer globally, first run the following commands from your terminal:Git
MySQL
Install MySQL server:Table Plus
You can use any application you like to manage your MySQL databases, but this is currently our preferred option. To install Table Plus on Linux, follow these steps:Node.js
You can install the latest version of Node.js by running:Node package manager
You will also need npm to install and manage packages as well as to run scripts. You can install this by running:Other required PHP extensions
You will need to manually install some PHP extensions by running the following command:- bcmath
- ctype
- curl
- fileinfo
- gd
- json
- mbstring
- mysql
- pdo
- sqlite-3
- tokenizer
- xml
- zip
Redis
To install Redis, run the following command:Valet
Valet is a Laravel development environment for macOS. However, there is a fork of it which was created for Linux - Valet Linux. To install Valet with Composer, run:Missing Valet requirements
If you get a message about missing Valet requirements, consult this documentation page for more info. On my system, I needed to run the following before running valet install again:Issues with Nginx
If you have a 502 gateway error with any of the applications that you’re developing, open the nginx config of your site: i.e. For ptchub.test you’ll find the config at~/.config/valet/Nginx/ptc-hub.test
- Within the second server block, copy the following before the closing curl bracket
- Restart valet
sudo valet restart
