Home | Downloads | Documentation | Plugins | Spinoff projects | Mailing List

System Requirements

These instructions have been updated for version 0.1.7.

phc needs a Unix-like environment to run (it has been tested on Linux, Solaris, and Mac OS X). To compile phc, you will need

  • gcc version 3.4.0 or higher (other compilers may work too, but they need to support covariant return types; YMMV)
  • make

To make full use of phc, you will also need

  • Xerces-C++ if you want support for XML parsing (you don't need Xerces for XML unparsing).
  • a DOT viewer such as graphviz if you want to be able to view the graphical output generated by phc (for example, syntax trees)

Finally, if you want to modify the internals of phc (in other ways than through the explicit API we provide for doing so), you will need the following tools:

  • flex (if you need to modify the lexical analyser)
  • bison (if you need to modify the syntax analyser)
  • patch (if you modify either the lexical or the syntax analyser)
  • ghc (to compile maketea, which is written in Haskell; you will need to compile maketea either if you want to modify the phc grammar (not an easy thing to do), or modify maketea itself)
  • gengetopt (if you need to add additional command line arguments; you will need version 0.16 or higher)
  • gperf (if you need to modify the list of keywords recognized by the lexical analyser)

However, most people should not need these tools (even if you are implementing tools based on phc).

It is possible to link phc to the Boehm garbage collector (known as libgc in many Linux distributions), but this feature is experimental and seems to lead to runtime errors on some systems. Use with care.

Installation Instructions

First of all, you must download the latest release of phc, and save it to some temporary location, for example /tmp. If VERSION is the version number of the copy of phc you have downloaded, the file will be called phc-VERSION.tar.gz. Thus, you should now have a file /tmp/phc-VERSION.tar.gz (for example, /tmp/phc-0.1.6.tar.gz).

Next you must decide where you want to extract phc. Here, we will assume that you want to extract it to your home directory (~). Extract phc as follows.

cd ~
tar xvfz /tmp/phc-VERSION.tar.gz

This will create a new directory ~/phc-VERSION that contains the phc source tree. Finally, you must compile phc. You should be able to simply type

cd ~/phc-VERSION
./configure
make

This should compile without any warnings or errors. If this step fails, please send a bug report to the mailing list with as much information about your system as you can give, and we will try to resolve it. Finally, install phc using

make install

For information on running phc, see Running phc. If you can follow those instructions and you get the output you should get, congratulations! You have successfully installed phc :-)

$LastChangedDate: 2006-09-08 12:24:58 +0100 (Fri, 08 Sep 2006) $. Contents © the authors.