If you’re reading this post it’s probably because you’re preparing for FileMaker DevCon 2019, are signed up to attend the FileMaker Data API Training Day session, and are looking to ensure you have everything you need set up on your laptop. If so, you’re in the right place! If not, feel free to have a read anyway!
Absolute Minimum Requirements
Please ensure that at the very least you have the following things installed on your laptop. If not look further below for OS specific instructions and get yourself ready before we get started. You won’t need PHP or a development editor until after lunch, so worst-case you could get those set up over the lunch break, or hook up with someone who already has those installed and peer programme your way through the afternoon.
- The absolute minimum requirement are the session resources – without those none of the rest of these tools are going to be very useful! Download them and save them to your local computer. If you are on Windows in some of the later activities things will be easier if the path they are at is relatively short, and has no spaces in it – something like
C:\dapi\resources
would work well! - FileMaker 18 Advanced – I’d be pretty sure you’ve got that ready to go, but if not remember that you get a copy included with your DevCon registration – details were given to you on a small card when you registered.
- Postman – Postman is an API development and testing environment which you can download (both Windows and OS X versions can be found there).
- A recent version of a browser with the developer tools enabled. Personally I use Firefox for development so if you want your system to look exactly the same as mine when we’re working on activities then it would be good to go there too. If you need to know how to enable dev tools, check out these instructions for Firefox, Chrome or Safari. If you’re using a different browser them I’m going to guess you’re technically sophisticated enough to know how to enable the dev tools 🙂
- Something to edit code in – as a minimum something like Notepad++ on Windows or BBEdit on OS X or a cross platform choice like Atom or Sublime Text.
Ideal Requirements
As well as everything above to get the most out of the workshop it would be great if you had the following things also installed.
- A recent version of PHP (at least 7.2). There are instructions below for how to get PHP installed if you don’t have it.
- An Integrated Development Environment (IDE) will make working with JavaScript and PHP easier than a straight text editor. Personally I’ll be using JetBrains PHPStorm which comes with a free 30-day trial license. Another very good choice is Microsoft Visual Studio which has a free ‘code’ version (if you decide to install Visual Studio see below for additional instructions).
- Having nodejs and yarn installed might be helpful if you’re already pretty familiar with PHP development, or want to try some of the more ‘advanced’ activities towards the end where you may find yourself need to recompile JavaScript. Instructions by operating system are below.
Installing PHP
The following instructions assume you're using Windows 10, though should still work on earlier versions.
- Install the Visual C++ Redistributable for Visual Studio 2015—this is linked in the sidebar of the PHP for Windows Download page, but it's kind of hidden. If you don't do this, you'll run into a rather cryptic error message,
VCRUNTIME140.DLL was not found
, andphp
commands won't work. It may already be installed depending on what other applications you have on your computer - so don't be too concerned if you get an error telling you it's already there! - Download PHP for Windows. The current version is 7.3.x and you'll want the non thread safe version. I downloaded the .zip file under the heading VC15 x64 Non Thread Safe.
- Extract the zip file into
C:\php
. - Configure PHP
- In
C:\php
rename the filephp.ini-development
tophp.ini
. - Edit
php.ini
file in your text editor (the one you made sure you'd installed above right) - Change the following settings in the file:
- Change
memory_limit
from128M
to1G
. - Change
upload_max_filesize
from2M
to25M
. - Uncomment the line that reads
; extension_dir = "ext"
(remove the;
so the line is justextension_dir = "ext"
). - In the section where there are a bunch of
extension=
lines, uncomment the following lines:extension=curl.dll
extension=gd2.dll
extension=mbstring.dll
extension=openssl.dll
- Change
- Save the file and you're done
- In
- Add
C:\php
to your Windows system path:- Open the Control Panel and switch 'View by' to Small Icons.
- Select 'System', 'Advanced System Settings' from the menu at the left.
- Click the 'Environment Variables...' button from the bottom of the 'Advanced' tab.
- Click on the
Path
row under 'System variables', and click 'Edit...' - Click 'New' and add the row
C:\php
. - Click OK, then OK, then OK, and close out of the System Control Panel.
- Open PowerShell (or another terminal emulator), and type in
php -v
to verify PHP is working. You should see something (very) like
PHP 7.3.7 (cli) (built: Jul 3 2019 14:34:15) ( NTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies
Thanks to Jeff Geerling for his original blog post Installing PHP 7 and Composer on Windows 10, Natively which these instructions are based on.
Installing node
Compared to PHP this is a snap!
- Check to see if you've already got node installed. In PowerShell type
node -v
. If you get anything other than (something like)v10.16.0
then it's not installed. - Head over to the node website downloads page and click on 'Windows Installer' from under the heading 'LTS'.
- Once it's downloaded click to launch, and basically 'smile and nod' your way through the installer, 'Next', accept those license terms, 'Next' three more times, 'Install', 'Yes', watch the pretty green line, 'Finish' and you're done.
- Back to PowerShell, but this bit's important, quit PowerShell and relaunch it because otherwise the shell won't have picked up the changes the installer just made.
node -v
and you should be greeted withv10.16.0
.
Installing yarn
Yarn is a package manager which helps you to install and manage JavaScript dependencies in your project. node comes with a 'built-in' package manager called npm, however yarn has some nice advantages so we're going to install that. Again it has an installer so it's pretty simple.
- Grab the installer by heading to the yarn installation page and selecting 'Download Installer'
- Once it's downloaded click to launch, and make your way through the installation process - fewer clicks than with node - and you're done
- Quit and relaunch PowerShell and type
yarn -v
and you should be greeted with1.16.0
.
The easiest way to manage development dependencies in OS X is to use Homebrew which bills itself as 'The missing package manager for macOS', so the first thing we need to do is get that installed. There are other ways to install PHP, node, etc but trust me they are way harder!
Installing Homebrew
- Head over to the Homebrew website and follow the (very) simple instructions there, or to make it even easier, copy and paste the line below into a terminal (Applications > Utilities > Terminal) and hit enter. Make sure you do include the closing quote!
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- The installer will tell you what it's about to do, hit Enter, and you'll then need to enter your password to allow things to be set up.
- Now sit back and wait it out - this process can take a little while because one of the requirements are the Xcode command line tools, which if you don't have Xcode installed are a weighty download.
Installing PHP
- Now that brew's installed things are pretty easy. In your terminal type
brew install php
. This will download and compile everything you need for PHP - Once it's done check that it worked with
php -v
, and you should see something (very) likePHP 7.3.6 (cli) (built: Jun 17 2019 08:40:34) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.6, Copyright (c) 1999-2018, by Zend Technologies - There're two changes we need to make to the default PHP config. Open
/usr/local/etc/php/7.3/php.ini
in your text editor (the one you made sure you'd installed above right?)- Change
memory_limit
from128M
to1G
(it should be line 401). - Change
upload_max_filesize
from2M
to25M
. - Save and close.
- Change
Installing yarn
Because of the power of Homebrew we can skip the 'install node' step because installing yarn will install node for us if we don't already have it!
- In your terminal type
brew install yarn
and hit enter. - Once it's done check that everything's worked using
node -v
which should return (something like, exact versions may not match)v12.5.0
andyarn -v
which should give you1.16.0
.
Installing Visual Studio Code
If you don’t currently have an IDE which you like and use, then Visual Studio Code is an excellent choice, if for no other reason than it’s free! It’s also cross platform.
- Head to the Visual Studio download page and select ‘Download’ from below ‘Visual Studio Code’ on the right hand side.
- Ok your way through the installer
- Once installed you’ll get the greatest benefit if you install two extensions to work with the demo materials which are written in PHP and use the Symfony framework. Launch Visual Studio Code and select File > Preferences > Extensions. In the extension search dialog enter:
PHP
and locate the extensionPHP IntelliSense
by Felix Becker. Select ‘Install’.-
Symfony
and locate the extensionSymfony for VSCode
. Select ‘Install’
- Close any tabs which have opened about the two modules you’ve just installed then select the
Explorer
icon from the top of the icon bar on the right to return to the Visual Studio workspace.