Skip to main content

Thread: HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx


just tested, works on ubuntu 10.10 maverick meerkat well.

have had google search able install php-gtk completely, , i'm going correlate how-to here. hope helps.

first, need install prerequisites installing php-gtk:

code:
sudo apt-get install build-essential subversion php5-cli php5-dev libgtk2.0-dev libglade2-dev
then need cairo php extension (required install php-gtk):

code:
cd ~/downloads  svn co http://svn.php.net/repository/pecl/cairo/trunk pecl-cairo  cd pecl-cairo  phpize  ./configure  make  sudo make install
then need following step in order ./buildconf , ./configure commands work when we're @ stage of installing php-gtk, reason (according others), newer libtool.m4 has been split different files. make php-gtk ./buildconf , ./configure work (and subsequently php-gtk installed), need concatenate different files libtool.

code:
cd /usr/share/aclocal  sudo cp libtool.m4 libtool.m4~backup  sudo chmod 777 libtool.m4  (start line) sudo cat lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 >>libtool.m4 (end line)  sudo chmod 644 libtool.m4
you're there. however, need latest svn version of php-gtk - if php-gtk source php-gtk website, error similar this:

error: duplicate ‘static’

...when running make command. in php-gtk 2.0.1, macro expands “static”. because zend_begin_arg_info() macros @ time didn’t mark variables static. introduced in 5.2.9. stands if compile php-gtk 2.0.1 against php 5.2.9 or later, duplicate static error. in svn repoistory, fixed. (thanks: http://devlog.mahcuz.com/2010/08/php...licate-static/)

counter problem, latest svn version:

code:
cd ~/downloads  svn co http://svn.php.net/repository/gtk/php-gtk/trunk php-gtk  cd php-gtk  ./buildconf  ./configure  make  sudo make install
once we've done - need few more things (although, php-gtk installed ).

in ubuntu 10.04, /etc/php5/cli/conf.d/ , /etc/php5/apache2/conf.d/ symlinks /etc/php5/conf.d/, need fix that:

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/
now need add php-gtk , cairo extensions php.ini file php recognise them: run php-config , find (near start) extension_dir line. may (or like) this:

code:
--extension-dir     [/usr/lib/php5/20090626+lfs]
that's php-gtk , cairo files php.ini need know about.

find php.ini file is, go places -> computer select file system left. click go->search files , search php.ini file. may find two. open each 1 , in gedit, @ application title bar , you'll see php.ini file from. if it's in cli directory, that's 1 need add extensions line in. close it, bring terminal window , type:

code:
sudo gedit /etc/php5/cli/php.ini
(modify php.ini file is, if applicable)

press ctrl + f , type dynamic extensions, you'll see list of information extensions , "commands" semi-colons @ start of them - these comments. above says "module settings" wrapped around semi-colons, add following;

code:
extension=php_gtk2.so  extension=cairo.so
this tells php these files called php-gtk , cairo within extension_dir it's aware of.

once done, it's time test php-gtk installation. in terminal, type: php ~/downloads/php-gtk/demos/phpgtk2-demo.php , php-gtk application should load up.

if have problems, feel free post. i'm sure .

this post works perfectly.

note if try "make test", tests fail, installed binary works fine on system.

can test bit after full install saving following lines in file called hello.php running "php ./hello.php".

<?php
if (!class_exists('gtk')) {
die("please load php-gtk2 module in php.ini\r\n");
}

$wnd = new gtkwindow();
$wnd->set_title('hello world');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));

$lblhello = new gtklabel("just wanted say\r\n'hello world!'");
$wnd->add($lblhello);

$wnd->show_all();
gtk::main();
?>


Forum The Ubuntu Forum Community Other Discussion and Support Tutorials HOWTO: How to install PHP-GTK in Ubuntu 10.04 Lucid Lynx


Ubuntu

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support