Sometimes it’s hard to know which PHP extensions you’ll need before you install PHP. In cases where you need to add extensions later on, you might get lucky and the extension could be in the repository of the OS you’re using. It might just be a simple sudo apt-get install php5-intl
away. In other cases, however, you might need to install it from source - Phalcon is one such case, but it makes the procedure extremely simple by introducing vendor support, shortcuts and pre-written instructions for your OS to carry out. What if there’s no such thing for other extensions, though?
In this tutorial, we’ll go through installing some custom extensions on Linux systems (and OS X - the process is nearly identical). The procedure is very similar to what we already did on Nitrous.io, but adapted for local environments - more specifically, Laravel Homestead. You can easily derive installation instructions from this tutorial and apply them to other distros.
Booting the VM
If you haven’t already, read the Homestead post linked above and get it up and running. Immediately after running a new Homestead box, you should be able to do this:
That’s perfectly fine, this happens because the folder that’s mounted by default actually doesn’t contain any files yet. Now vagrant ssh
into the VM, and execute the following commands:
cd Code
git clone https://github.com/Swader/publicinfo
This creates a valid PHP Info file in the path that Homestead is set to by default. Refreshing the URL will now produce a PHPInfo screen:
Prepping the Environment
To build extensions from source, we need the PHP dev tools installed on our machine, as well as a compiler that can produce the extension file. Here’s how you install these prerequisites on various operating systems:
Continue reading %How to Install PHP Extensions from Source%
more
{ 0 comments... » How to Install PHP Extensions from Source read them below or add one }
Post a Comment