In my Beyond Frameworks talk, I explained how a component-based architecture can help answer some of the important (i.e. expensive!) questions you might face when creating long-lived apps that rely on a PHP framework. In this series of blog posts, I’m going to look at how to go about creating and working with components.

We’ve created a development tool, called phix, to make it as easy as possible to create and maintain your own components written in PHP. Follow these easy instructions to get phix installed on Ubuntu.

Using The One-Line Installer

The easiest way to get phix installed onto your Ubuntu box is to run the following command from a Terminal window:

curl -O ; sudo bash

This command downloads a simple shell script (which you can find on GitHub if you want to read it before trying it!), and which is then run as the user “root”. The shell script:

  • Makes sure that you have a suitable version of PHP installed
  • Uses apt-get to install required dependencies
  • Uses the pecl command to install PHP extensions that we can’t get packaged for Ubuntu
  • Upgrades the PEAR installer to the latest version
  • Installs the package phix/phix4componentdev, plus dependencies, from the PEAR channel

If all goes well, once everything has finished, run the following command and you’ll see that phix is now installed:

$ pear list -c phix | grep phix
phix                       0.13.2  stable
phix4componentdev          0.13.2  stable

Where To Find The Latest Installation Instructions

You can always find the latest installation instructions for phix on the Phix project’s website, including full instructions on how to do a manual install if you have trouble with our one-line installer.


  1. Adam says:
    October 3rd, 2011 at 9:18 am

    The one line installer errors out on my stock ubuntu 11.04 install, tried on both my pc at work and laptop at home, both failed. If I copy the lines one by one it doesn’t die, and it installs ok, however still displays error messages about out of date modules.

  2. cordoval says:
    October 3rd, 2011 at 1:47 pm

    i am getting this error

    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20090626/’ – /usr/lib/php5/20090626/ cannot open shared object file: No such file or directory in Unknown on line 0

  3. Stuart Herbert says:
    October 3rd, 2011 at 2:17 pm

    @adam: could you send me a copy of the errors that you get? Many thanks.

  4. Stuart Herbert says:
    October 3rd, 2011 at 2:24 pm

    @cordoval: that means the ncurses extension didn’t compile and install successfully. did the install script complete to the end successfully? if not, please try running it once more.

  5. Adam says:
    October 3rd, 2011 at 3:56 pm

    Is there an easy way to uninstall everything so I can run the script again? If not it will be a couple of days before I get chance to try it on another ubuntu machine, but I will check and send the errors.