Subentry of
PHP-GTK
Mon28May2007
- Contents
I have compiled PHP-GTK2 for several of the modern UNIX derived operating systems:
• Linux.
• FreeBSD.
• Solaris.
You must have at least the following applications/packages installed to use PHP-GTK.
• PHP 5.2.2 with CLI.
• GTK+ 2.10.
• LibGlade.
Getting PHP-GTK Installed
Download and extract files, one of which is the the php_gtk2.so from the tarball, place it in the PHP extension directory. This is usually /usr/lib/php/extensions or somewhere similar. If you are unsure, consult your PHP.INI for the extension_dir setting. Do not forget to load it with a new extension line for php_gtk2.so in PHP.INI.
Please note if you are running Apache, you should not be using the same PHP.INI file for PHP-GTK as you are for the web server. See This page of the KateOS Documentation for an example PHP.INI suitable for PHP-GTK.
Adding Features to PHP-GTK2
By default the build of PHP-GTK on this page has LibGlade and Scintilla built in. This means you should have already installed LibGlade prior to installing PHP-GTK, however Scintilla is shipped with PHP-GTK therefore no extra libraries are needed.
Configure for Basic Package
./configure --enable-scintilla --with-libglade
There are extra libraries you can add to PHP-GTK to add more functionality and widgets. These are not compiled into the main PHP-GTK extension. First make sure you have the normal library installed. Then download and extract the extension tarball and place the .so file in your PHP extension directory with the php_gtk2.so file.
You must also edit the PHP.INI file. Under the PHP-GTK section there should be a directive called php-gtk.extensions. If that option does not exist, or the entire section is missing, refer to the Default PHP-GTK Config example below to see what to add to your PHP.INI.
Most applications will not require the installation of additional extensions. You only need to install them if for example, you want to run a text editor that uses GtkSourceView. In that case then you should install the GtkSourceView library and get the PHP-GTK extension for it. If it is an application you downloaded, the project page for that application should tell you if you need anything other than the normal extension.
Default PHP-GTK Config
[php-gtk]
php-gtk.codepage = "UTF-8"
php-gtk.extensions = ""
Load the GtkSourceView extension
php-gtk.extensions = "php_gtk2_sourceview.so"
Load the GtkSourceView, LibSexy, and GtkSpell extensions
php-gtk.extensions = "php_gtk2_sourceview.so, php_gtk2_libsexy.so, php_gtk2_spell.so"
Version: CVS Snapshot of 2007-07-20 (post-beta)
Machine: Linux 2.6.21.1, PHP 5.2.2, Gtk 2.10.13
Download: php_gtk2-cvs20070720-linux-bob1.tar.bz2
Version: CVS Snapshot of 2007-07-20 (post-beta)
Machine: Solaris 10, PHP 5.2.2, Gtk 2.10.13
Download: php_gtk2-cvs20070720-solaris-bob1.tar.bz2
none yet (sorry)
Download PHP-GTK Extensions
LibSexy: php_gtk2_libsexy-cvs20070719-linux-bob1.tar.bz2
GtkSourceView: php_gtk2_sourceview-cvs20070719-linux-bob1.tar.bz2
GtkSpell: php_gtk2_spell-cvs20070719-linux-bob1.tar.bz2
LibSexy: php_gtk2_libsexy-cvs20070720-solaris-bob1.tar.bz2
GtkSourceView: php_gtk2_sourceview-cvs20070720-solaris-bob1.tar.bz2
GtkSpell: php_gtk2_spell-cvs20070720-solaris-bob1.tar.bz2
none yet (sorry)
If you experience problems (like error messages, crashes) while using these files, please feel free to contact me bob at kateos dot org and I will try to help you out.
If you have questions more along the lines of using it, perhaps similar to "How do I make GtkWindow a fixed size?", then I would prefer you join us on IRC, irc.freenode.net, channel #php-gtk - though if I am having a good day I might answer those emails too.
Frequently Asked Questions
Question
How do I know if I have the PHP Command Line Interface (CLI)?
Run the command `php --version` on a terminal window. If you get output simular to the following, then you are good. If you get a missing command error, then you need to install the php5-cli package for your distribution or recompile PHP with --enable-cli.
php --verison
PHP 5.2.2 (cli) (built: May 4 2007 09:25:44)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Question
What about downloads for Windows?
Do not look at me, I am the Unix guy. Check out Elizabeth's PHP / PHP-GTK builds on perisama.net.
Question
Will you make a package for (Ubuntu|RedHat|Any Distro)'s package management system?
No. Link your package/distro maintainers here and ask them if you need it, else learn the terminal. It would be good for you anyway. My good buddy Leon Pegg does have an Ubuntu Repository, but do not ask me how to go about it, I have not touched Ubuntu in ages.
•
PHP-GTK Reference Manual.
•
PHP-GTK Community Website.
• Elizabeth's builds for
PHP-GTK on Windows.
• Leon Pegg's
Ubuntu Repository.