Skip to content
philip edited this page Sep 13, 2010 · 1 revision

A cookbook of things you might want to do with PhpVersionBuilder.

Run the script
$ php run.php

Only build PHP 5.3 versions

  1. Open inc/config.php
  2. Change $php_versions to array(‘5.3.0’);

Pass in configure options to every build

  1. Open inc/config.php
  2. It’ll be something like
    
    $config_options_all = array(
    	'--disable-all', 
            '--enable-mbstring',
    	'--disable-cgi', 
    	'--enable-cli',
    );
    

Pass in branch (e.g., 5.2, 5.3) specific configure options

  1. Open inc/config.php
  2. Change $config_options_versions to something like:
    
    $config_options_versions = array(
    	'5.2' => '--with-foo',
    	'5.3' => '--enable-bar',
    );

Pass in options before configure

  1. Open inc/config.php
  2. Change the following to something like:
    
    define ('PRE_CONFIGURE', 'EXTRA_FLAGS=-lfoo');
    

Execute a PHP script with all built versions, and output as HTML colored by output

  1. Place your code in a PHP file
  2. Use execute_php.php that’s located inside PhpVersionBuilder
  3. Execute it, someone what like the following:
    
    $ ./execute_php.php mycode.php html > output.html
    
  4. Then you might copy it to docroot and view, or open using ‘open’ or ‘firefox’ like so:
    
    $ firefox output.html
    $ open output.html
    
  5. Note: Several test PHP scripts to test output live in scripts/out/