Click On Tyler Support


Contact Us

Support Home » VirtualHostX » How To's

How To Install a PHP Extension

Last Updated February 29, 2020

VirtualHostX includes most common PHP extensions by default. But if you're working on a website that needs one that isn't included, installing it is typically pretty simple. And that's the great thing about VHX's approach to running websites on your Mac. Because the app uses a real Ubuntu Linux virtual machine under the hood (like many real web servers do), you can install and modify whatever you want - and there are thousands of tutorials avaiable online with instructions on how to do just about anything.

In this example, we're going to install the PHP Zip extension.

Once you've finished installing VirtualHostX, go ahead and setup your first website and verify that you can access it in your web browser. Then...

1. Login to the virtual machine. The easiest way to do this is just to click the Terminal icon/button in the VHX toolbar. Here are detailed instructions.

2. Once the Terminal window opens and you're logged in, type (or copy and paste) this command and press return to run it...

sudo apt-get -y install php7.2-zip

That will install the PHP Zip extension. It should typically take less than 30 seconds to complete.

3. Finally, restart the virtual machine for the changes to take effect. Select the "Restart" command under the VHX "Virtual Machine" menu.

And that's it! Once the web server starts back up, you should be good to go.

Most other PHP extensions are installed the same way. Just google around for the right command. Searching for something like "ubuntu install PHP <name of extension> extension" should find what you need. If you have trouble, feel free to reach out and I'll be happy to help.