PHPBuilder - Getting Started with PHP-GTK: Part 1

RSS Twitter

Getting Started with PHP-GTK: Part 1

by: Ray Hunter
August 26, 2004

With the release of PHP5, there has been renewed interest in the PHP-GTK extension. What does the PHP-GTK extension provide? "PHP-GTK implements language bindings for GTK+." PHP-GTK provides the means for a developer, familiar with PHP, to create rich clients using the PHP programming language.
Installation has already been cover in John Starkey's article "Installing PHP-GTK on Linux". If you have not already read this, I would highly recommend it. There are a few comments I'd like to add to the installation process. Let me point out that the website has the same documentation layout as does PHP and the quality of the documentation is also top notch. I also highly recommend reading the installation section of the documentation for both Windows and Linux users. For those users of Gentoo, my favorite distro, there is an ebuild that works great too.
Verify Installation
To verify the installation we need to create a simple script that will test whether the extension is loaded and, if not, will load the extension. The script is as follows:

if(!extension_loaded('php_gtk')) {
$loaded dl('php_gtk.'.PHP_SHLIB_SUFFIX);
  } else {
$loaded true;
"Extension loaded: ";
  echo (
$loaded) ? "true\n" "false\n";
This will produce either an "Extension loaded: true" or "Extension loaded: false".
If the extension is loaded into PHP then you can move to the next section. Otherwise review the installation instructions at the PHP-GTK website.

Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Ray Hunter



(Maximum characters: 1200). You have characters left.