Download Instructions

This tutorial will explain the installation process via Composer, which is recommended. However if you don’t wish to use it, you can always download the latest snapshot of PHPixie.

Getting Composer
Composer is a package manager for PHP, if you ever used Linux you may be familiar with applications like apt or yum that are used to install all kinds of software. Composer does the very same thing with PHP libraries, you tell it which ones you want, and it downloads them for you. Getting composer is easy, let’s assume we want to install it into our /var/www/ folder, we just need to run this:

cd /var/www/
php -r "eval('?>'.file_get_contents(''));"

After the script executes you should have a composer.phar file in that directory.

Setting up the skeleton project
PHPixie tries to be as flexible as possible, you can dow whatever you want with the API that it provides, but the most standard site would follow a common skeleton architecture. After you have composer.phar in /var/www/ you can just run the following:

cd /var/www
php composer.phar create-project phpixie/project tutorial 2.*-dev --prefer-dist
cd tutorial

#If you are on Linux
php ../composer.phar update -o

#If you are on Windows
php ..\composer.phar update -o

These commands will download the skeleton project together with all its dependencies and optimize your autoloader.

Alternative: Setting up the skeleton project manually

You can get the skeleton application here: . Download is a Zip Archive and extract to /var/www/tutorial.

Instructions for Ubuntu 14.04

There is nothing special with installing PHPixie on Ubuntu, but since it is such a popular environment, here are some additional details on Apache configuration.

Put the following into /etc/apache2/sites-available/001-phpixie.conf

<VirtualHost *:80>
        ServerName pixie.local

        ServerAdmin webmaster@localhost

        #Assuming you installed PHPixie into /var/www/tutorial
        DocumentRoot /var/www/tutorial/web

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/tutorial/web>
             AllowOverride All

Create a symlink to the file by running:

sudo ln -s /etc/apache2/sites-available/001-phpixie.conf /etc/apache2/sites-enabled/001-phpixie.conf

Add this line to your /etc/hosts: pixie.local

Enable Apache Rewrite module:

sudo a2enmod rewrite

Restart Apache:

sudo /etc/init.d/apache2 restart

Visit http://pixie.local/ in your browser

Now we need to get all of the PHPixie libraries. This is where Composer comes in, we will use it to download everything that our project needs. In the composer.json file you will see a list of required dependencies like this:

"require": {
        "phpixie/core": "2.*@dev",
        "phpixie/db": "2.*@dev",
        "phpixie/orm": "2.*@dev"

This requests PHPixie core and database libraries, if you ever need to add a PHPixie module, or any PHP library to your project you can use that file to request it. Now run this to install dependencies:

cd /var/www/tutorial
php ../composer.phar install -o --prefer-dist

When the script finishes you should have all required libraries installed in your vendor folder. If you ever want to update them to the latest version just run:

cd /var/www/tutorial
php ../composer.phar update -o --prefer-dist

Now all that is left to do is configure your Apache to point it to the /var/www/tutorial/web/ folder, be careful and don’t miss out the /web part of the path. You should see a greeting from PHPixie, so you are on the right track.

28 thoughts on “Download Instructions

  1. IonTichy

    “Take a quick look at it, and you’ll notice that the /vendor folder is empty..”

    umm, I took a look at it and there is no such thing as a /vendor folder…

    please update this tutorial or correct it!

    1. admin Post author

      Ah, it doesn’t matter. It will get created as soons as you run composer. I’ll update the tutorial to reflect this. Thanks

      1. IonTichy

        yeah, I kinda realized that when building with composer, sorry bout that.
        but thanks for updating, it is a little bit confusing…

        now all works ;)

  2. bernard

    Is there a link where you can download the entire package + ALL the modules instead of using composer? Great work by the way.

  3. ian

    I didn’t get a welcome page I got a ‘No route matched your request error’

    And that was only when I added the index.php to the url.

    I tried setting the MAMP apache base directory to the ‘web’ folder but no luck.

    All the install instructions with Composer went fine.

  4. Shiju S S

    Getting the following error:

    Class App\Controller\Web doesn’t exist

    94 */

    95 public function controller($class) {

    96 if (!class_exists($class))

    97 throw new \PHPixie\Exception\PageNotFound(“Class {$class} doesn’t exist”);


    99 return new $class($this);


    181 {

    182 $this->pixie->cookie->set_cookie_data($this->_cookie);

    183 $class = $this->param(‘namespace’,$this->pixie->app_namespace).’Controller\\’.ucfirst($this->param(‘controller’));

    184 $controller = $this->pixie->controller($class);

    185 $controller->request = $this;

    186 $controller->run($this->param(‘action’));


    229 try {


    231 $request = $this->http_request();

    232 $response = $request->execute();

    233 $response->send_headers()->send_body();



    3 $loader = require $root.’/vendor/autoload.php';

    4 $loader->add(”, $root.’/classes/’);

    5 $pixie = new \App\Pixie();

    6 $pixie->bootstrap($root)->handle_http_request();

    7 ?>

  5. Rich7

    Installed composer to test some frame works. Installing laravel worked with the quickstart, but when I paste your example in my windows cmd frame it gives errors. Shouldn’t a composer command line look like
    > composer create-project xxx/yyyy –prefer-dist


  6. rizki

    I’m trying to install using command prompt (win) and via shell (xampp), still got bounce whenever I try go to /web path, it throw me back to localhost page (which xampp page / localhost/xampp), still I don’t know what happen. And if I try to use force to visit the web/index.php it show me “No route matched your request” message, so basically this not show me any *greeting*

    1. admin Post author

      You don’t need to go the /web in your browser. You should configure xampp so that your root folder is the /web/ folder on disk.

  7. Pingback: Setup PHPixie with MAMP - Michael Cale

  8. platz

    I did all the steps here, and I set up my apache to “home/myusername/fairy/projects/tutorial/web”. When I go to http://lolcalhost/ I get this “add(”, $root.’/classes/’); $pixie = new \App\Pixie; $pixie->bootstrap($root)->handle_http_request(); “. Is this normal?

    1. admin Post author

      Strange, it serms that index.php is not being parsed. Is everything ok when you try some other php files ? Maybe try uploading some simple test php script and see if that one parses

  9. Pingback: » Инструкция по установке

    1. admin Post author

      You should configure your webserver to serve from the /web/ folder. On your screenshot the /web/ is clearly in the url.

    1. admin Post author

      Still working on it =) You can check out my github profile for progress. OR is almost at 100% coverage. Planning to release it this week


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>