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:
then need cairo php extension (required install php-gtk):code:sudo apt-get install build-essential subversion php5-cli php5-dev libgtk2.0-dev libglade2-dev
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 ~/downloads svn co http://svn.php.net/repository/pecl/cairo/trunk pecl-cairo cd pecl-cairo phpize ./configure make sudo make install
you're there. however, need latest svn version of php-gtk - if php-gtk source php-gtk website, error similar this: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
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:
once we've done - need few more things (although, php-gtk installed ).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
in ubuntu 10.04, /etc/php5/cli/conf.d/ , /etc/php5/apache2/conf.d/ symlinks /etc/php5/conf.d/, need fix that:
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: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/
that's php-gtk , cairo files php.ini need know about.code:--extension-dir [/usr/lib/php5/20090626+lfs]
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:
(modify php.ini file is, if applicable)code:sudo gedit /etc/php5/cli/php.ini
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;
this tells php these files called php-gtk , cairo within extension_dir it's aware of.code:extension=php_gtk2.so extension=cairo.so
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
Post a Comment