Results 1 to 10 of 33

Thread: HOWTO: Compile php-gtk2 for Lucid Lynx

Threaded View

  1. #1
    Join Date
    Jul 2007
    Location
    Sweden
    Beans
    24

    HOWTO: Compile php-gtk2 for Lucid Lynx

    This is a mini-howto i collected from various outdated sources & a little testing.

    The php-gtk2 package is currently not provided in the ubuntu repositories, it also depends on the pecl extension cairo.

    When finished, you should have php-gtk2 running with php 5.3.

    First the dependencies:

    Code:
    sudo apt-get install build-essential subversion php5-cli php5-dev libgtk2.0-dev libglade2-dev libcairo2-dev re2c
    Then install pecl cairo from svn:

    Code:
    svn co http://svn.php.net/repository/pecl/cairo/trunk pecl-cairo
    cd pecl-cairo
    phpize
    ./configure
    make
    sudo make install
    Next, install php-gtk2 from svn:

    Code:
    svn co http://svn.php.net/repository/gtk/php-gtk/trunk php-gtk
    cd php-gtk
    ./buildconf
    ./configure
    make
    sudo make install
    Assuming all went well, configure the extensions to load with php5-cli.

    IMPORTANT: in Ubuntu Lucid, /etc/php5/cli/conf.d/ and /etc/php5/apache2/conf.d/ is symlinks to /etc/php5/conf.d/
    This means that if you install php_gtk2 in this directory, it will also load when php is ran from Apache,
    causing server to crash. php_gtk2 is only meant to be run from the cli.

    So first remove the symlink, make a ordinary cli/conf.d/ directory and copy the .ini files there:

    Code:
    sudo rm /etc/php5/cli/conf.d
    sudo mkdir /etc/php5/cli/conf.d
    sudo cp /etc/php5/conf.d/*.ini /etc/php5/cli/conf.d/
    Then install php_gt2k + cairo extensions:

    Code:
    echo "extension=/usr/lib/php5/20090626/php_gtk2.so" | sudo tee /etc/php5/cli/conf.d/php_gtk2.ini
    echo "extension=/usr/lib/php5/20090626/cairo.so" | sudo tee /etc/php5/cli/conf.d/cairo.ini

    Finally, verify they load correctly

    Code:
    php -m | grep php-gtk
    Good luck!

    EDIT: fixes as suggested by Compyx
    Last edited by martin_lindhe; May 10th, 2010 at 08:43 AM. Reason: updated install instructions

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •