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:
Then install pecl cairo from svn:Code:sudo apt-get install build-essential subversion php5-cli php5-dev libgtk2.0-dev libglade2-dev libcairo2-dev re2c
Next, install php-gtk2 from svn:Code:svn co http://svn.php.net/repository/pecl/cairo/trunk pecl-cairo cd pecl-cairo phpize ./configure make sudo make install
Assuming all went well, configure the extensions to load with php5-cli.Code:svn co http://svn.php.net/repository/gtk/php-gtk/trunk php-gtk cd php-gtk ./buildconf ./configure make sudo make install
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:
Then install php_gt2k + cairo extensions: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/
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
Good luck!Code:php -m | grep php-gtk
EDIT: fixes as suggested by Compyx



Adv Reply




Bookmarks