Previous: Installing the Roadsend PHP Web Interpreter, Up: Using The Web Interpreter


5.1.2.2 Developing With The Interpreter

Now that the interpreter is installed you can interpret your project directly from the source code. Any changes you make to the code will be immediately visible by reloading the web page.

Include Path

You may need to configure the include path so that your application can find all the files it needs to interpret. See Configuration.

Web Interpreter Debugging

If you have a problem interpreting your project, try adjusting the debug-level in the Configuration and checking the error log of your web server for verbose debugging information.

You can also interpret the individual files of your project from the command line. Use the -f parameter:

     $ cd /var/www/localhost/htdocs/project
     $ pcc -d 2 -f index.php

Using Compiled Libraries From Interpreted Applications

Interpreted web applications can make use of compiled libraries. To load a compiled library, use the web-libs directive in the pcc.conf configuration file. In Windows, you can use the Roadsend Studio IDE to edit the list of web libraries.

To use a library, it first needs to be installed into one of your library paths as specified in your pcc.conf file.

     
         ; library load path
         (library "/usr/lib/roadsend" "/usr/local/pcc")
     
         ; load the library test-lib
         (web-libs "test-lib")
     

When a new pcc.fcgi process is spawned it will load the libraries listed in the web-libs section.

Any time the interpreter encounters a require() or include() it will search the loaded web-libs for a compiled version of the requested file.

If the requested file is found then the compiled version is executed.

If the requested file is not found in a compiled library then the include path is searched. The source file is interpreted if found or else a runtime error occurs.