Compdigitec Labs

« | Home | »

Install Roadsend PHP Compiler on Ubuntu - without compiling anything!

By admin | July 24, 2008

Update (2010-07-21): Due to vast interest in getting the packages to work, we have released a updated version of the Roadsend PHP compiler.

Update (2008-09-06): The binary packages are not AMD64 compatible (thanks to Tom in the comments). You may wish to compile your own packages following the instructions in this article. The binaries are compatible with x86/i386/i686/x86_64 only.

Roadsend PHP is an actively developed PHP compiler. Unfortunately, it is not available for the extremely popular Ubuntu Linux. This post will help you install Roadsend PHP on your Ubuntu Linux machine in 5 easy steps.

  1. If you have the repository (in other words, from synaptic) version of Bigloo and any roadsend packages installed, remove them now.
  2. Install the unofficial Bigloo and Roadsend PHP compiler packages: (install unofficial bigloo first)
  3. If you are setting up Roadsend PHP per-user, add this line to each user’s “~/.profile”. To set Roadsend PHP up system-wide, add it to “/etc/profile”.export LD_LIBRARY_PATH=/usr/local/lib
  4. You’re almost done! Compile a test program to test it:<?php
    echo "Hello World! - This is the Roadsend PHP test program.\n";
    ?>
    Save it in index.php . Then compile it and run it:
    pcc index.php
    ./index

    You should get this output: “Hello World! - This is the Roadsend PHP test program.”. If you get this error instead “./index: error while loading shared libraries: libphp-runtime_u-3.0c.so: cannot open shared object file: No such file or directory”, it means that you have not yet set LD_LIBRARY_PATH as in Step 3. Set it manually by executing:

    export LD_LIBRARY_PATH=/usr/local/lib

  5. To test the MicroServer backend, compile with the following command:
    pcc -s testprog --port 54321 index.php
    To avoid another fatal error, copy the PHP core runtime with the following command:
    cp /usr/local/lib/libphp-runtime_u-3.0c.so ./
    ./index
    Then browse to http://127.0.0.1:54321/ and you should see “”Hello World! - This is the Roadsend PHP test program.”

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux, PHP | 12 Comments »

12 Responses to “Install Roadsend PHP Compiler on Ubuntu - without compiling anything!”

  1. Tom Says:
    September 5th, 2008 at 2:38 pm

    I get a config file error trying to compile a test program. Do you have a forum for help?

    >>> Config file /y/usr/etc/pcc.conf not found.
    Error: problem running command ‘bigloo’, exit status 1

    Thanks.

  2. admin Says:
    September 5th, 2008 at 2:54 pm

    @Tom: Yes, we do. See http://www.compdigitec.com/forums/ for free support.

    By the way, I think that your error is caused by you not installing bigloo-compdigitec-unoffical, because the error suggests that Bigloo 3.0c is not installed.

  3. Tom Says:
    September 5th, 2008 at 2:58 pm

    Apparently this is not amd64 compatible installation?
    Seems it’s baring on library something.

  4. Tom Says:
    September 5th, 2008 at 3:08 pm

    Confirmed, it’s not amd64 compatible. I’ll compile an amd64 version when I get more time. The compile needs things like bigloo that aren’t in the current Lenny repository.

  5. Antony Says:
    September 11th, 2008 at 4:24 am

    I’m having problems installing. Firstly - double clicked on the packages and they said they werent valid Archives.

    Now trying sudo -i dkpg or whatever it is and its asking for a password?

    TIA

    A

  6. admin Says:
    September 11th, 2008 at 7:20 pm

    @Antony: Try using “sudo dpkg --install the_file.deb”.

  7. Justin Says:
    January 31st, 2009 at 9:50 pm

    Decided to play around with these as compiling myself was proving more arduous than i had the patience for… but when I try to compile the test it can’t find “libphp-u_gtk3.0c.so”

  8. James Says:
    November 14th, 2009 at 4:54 pm

    FYI I had the same error as Tom:
    >>> Config file /y/usr/etc/pcc.conf not found.
    Error: problem running command ‘bigloo’, exit status 1

    I had added export LD_LIBRARY_PATH=/usr/local/lib to the profile, but I think it might require you to log out & back in - I didn’t do this as I have lots open, but you can just type the same command into the terminal and it works fine:

    export LD_LIBRARY_PATH=/usr/local/lib

  9. Adrian Says:
    January 10th, 2010 at 10:04 am

    I got the ‘/y/usr/etc/pcc.conf not found’ error too.
    Without really working out what Roadsend is doing, this seems to be due to assumptions about the location of standard directories that aren’t true in my case (Ubuntu 9.04). It’s nothing to do with LD_LIBRARY_PATH not being set.

    First, /y is a symlink to /, so /y/usr/etc/pcc.conf is the same file as /usr/etc/pcc.conf. Or it would be if it existed. It’s actually installed to /usr/local/etc/pcc.conf

    To fix this, create the dir and symlink to the file:
    cd /usr
    sudo mkdir etc
    cd etc
    sudo ln -s /usr/local/etc/pcc.conf pcc.conf

    This will make pcc.conf visible to the program.

    Then the next error shows up: it can’t find libphp-u_gtk3.0c.so. In my Ubuntu 9.04, it and other libraries are in /usr/local/lib.

    To fix this we must edit pcc.conf
    sudo gedit /usr/local/etc/pcc.conf

    in pcc.conf, under the line
    (library “./” “/y/usr/lib”)
    add these lines

    ;ADDED because that’s where libphp and other libraries are
    (library “./” “/usr/local/lib/”)

    The next error I got was because I don’t have php-gtk installed. You may already have it, or want to install it, but I simply removed ‘ php-gtk’ from the two lines which contain it. Recommend you save the old line versions to comments in case you need them and forget what you did.

    This has got me to the ‘hello world’ stage. I’ll report on further issues as they come up.

  10. Quan Bui Says:
    June 2nd, 2010 at 10:28 pm

    hoangquan@ubuntu:/var/www$ pcc -h

    Warning: /y/usr/etc/pcc.conf: Specified directory does not exist: “./” in unknown on line 0

    Warning: /y/usr/etc/pcc.conf: Specified directory does not exist: “/usr/local/lib/” in unknown on line 0

    Anybody help me, please?
    Thanks all. I very like this topic.

  11. FootPrints Says:
    July 25th, 2011 at 5:22 am

    [...] Install Roadsend PHP Compiler on Ubuntu – without compiling anything! at Compdigitec Labs [...]

  12. maxim Says:
    January 23rd, 2013 at 9:20 pm

    como se compila con pcc librerias de snmp,net-snmp, php-snmp

Comments