Skip to content
The PHP GTK Bindings
C++ C Scheme PHP Makefile JavaScript Other
Branch: master
Clone or download
Latest commit c959799 May 25, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
build2 Remove broken "fix" for build issues with newer libtool May 24, 2010
demos Add little hack to make sure user classes get Aug 15, 2012
ext Change error on gtk_init to report the actual error from gtk for bett… Jun 24, 2014
generator Rest of missing gtkgenerator changes Jun 24, 2014
main Fixed compile with 5.5. Added VC11 compatibility Jun 28, 2013
tests Normalize line endings for tests Jun 24, 2014
win32 cleanup of outdated files Jun 23, 2014
.gitattributes Normalize line endings for tests Jun 24, 2014
.gitignore Missed yet another gitignore for autotools junk Nov 8, 2012
AUTHORS Credits for Tom. Jun 15, 2007
CODING_STANDARDS Might as well enforce the standards on the file itself. Oct 28, 2005
COPYING.LIB Override gtk_tree_item_new to allow specifying a label. Feb 19, 2001
ChangeLog Added defs for GTK 2.22 Dec 3, 2010
INSTALL Some more typos :-/ Jun 23, 2006
NEWS Fixed bug #51093 (segfault with signal_autoconnect function of class … Apr 30, 2010
NEWS.pre-2-0 Split NEWS. Update version. Jul 13, 2006
README Fixed broken links May 25, 2015
README.KNOWN-ISSUES Update for 2.0.0 release. Feb 29, 2008
TODO2 Now installing api headers Sep 22, 2010
buildconf - Use the $PHPIZE from environment if it is not empty Jun 2, 2005
buildconf.bat Forgot the buildconf.bat :) Sep 2, 2005
config.m4 Now installing api headers Sep 22, 2010
makedist Clean up after packaging. Jun 23, 2006
php_gtk.m4 Fixed shared extensions linking in Unix. Oct 14, 2008


PHP-GTK: PHP language bindings for GTK+ toolkit
PHP-GTK is a PHP extension that enables you to write client-side cross-platform
GUI applications. This is the first such extension of this kind and one of the
goals behind it was to prove that PHP is a capable general-purpose scripting
language that is suited for more than just Web applications.

This extension will _not_ allow you to display GTK+ programs in a Web browser,
and can be used in the Web environment only if you are running the webserver
locally. It is intended for creating standalone GUI applications.

As a prerequisite, you should have a CLI binary (command-line) version of PHP
installed along with the header files and development scripts. They should
normally be installed when you do 'make install' in the PHP source tree.

Currently, PHP-GTK requires PHP 5.1.2 or greater to run, and to build.

PHP-GTK supports GTK+ v2.6 and requires v2.6 or greater. The latest stable
release of GTK+ can be obtained from

Installation and testing
After unpacking the distribution or checking out the sources from the CVS,
change into the base directory and do the following.

First, run './buildconf' script that comes with PHP-GTK. It will set up
necessary files and create 'configure' script for you.  Next, run './configure'.
It will check that you have proper version of GTK+ and other files required for
compilation and create the Makefile's.

PHP-GTK supports extensions which can be configured via 'configure' script
switches that you can see by running './configure --help'.

Finally, run 'make' to compile the extension. Some source files are generated
from .defs files by the code generator. If you see messages like "Could not
write...", that just means that certain GTK+ objects or features are not yet
supported. If the compilation is successful, run 'make install' to install the
extension into your default PHP extension directory.

To test the extension, try running the demo scripts in the demos/ directory,
especially phpgtk2-demo.php. These are also good for showing how the extension
can be used.

The website for this extension can be found at:

This is where you should go to obtain the latest releases and news about

Mailing lists
There are several mailing lists for PHP-GTK.

   * General list
     This list is for general discussion of PHP-GTK, techniques, problems,
     development of applications, questions, and other issues.

     List address:

   * Developers list
     This list is for those wanting to help with development of PHP-GTK and its

     List address:

   * Documenters list
     This list is for those discussion and development of PHP-GTK documentation.

     List address:

To subscribe to any of the lists, send blank email to the appropriate
subscription address.

Patches and feedback
Please use the mailing lists for most of your questions -- many people read
them and you are more likely to get quicker feedback if you post there first.
Patches in the unified diff (diff -u) format should be sent to the developers
list (see above).

The person I would like to thank the most is James Henstridge
<>, the author of PyGTK (Python GTK+ bindings). His help and
advice have proved invaluable during the development of this extension, and a
fair amount of source code is based on or inspired by what he has developed for

I'd also like to thank PHP team for making such a great language and the GTK+
team for developing what has to be the best C-based GUI toolkit.

# vim: set et tw=80 ai sts=4:
You can’t perform that action at this time.