Monday, November 30, 2015 
download | documentation | applications | faq | changelog | resources 

search for in the  

previousInstallation on Windows
Installation on Mac OS Xnext

Last updated: Sun, 12 May 2013
view this page in English

The best way to install PHP-GTK 2 on Linux is to compile it. No binary or source packages are available as yet for any distribution, so you can't use your favorite package manager to install PHP-GTK 2! These instructions should be valid for most distributions of Linux, as well as other POSIX compliant systems.

There are two ways to go about installing PHP-GTK 2 on your Linux system. You can either choose to use your existing PHP installation, or decide to install a separate one and dedicate it to PHP-GTK 2. The latter is a simpler method and is recommended for users with little or no Linux experience. In any case, you need Gtk+ version 2.6 upwards installed.

Just follow these steps, and you should be okay! First thing you need is a fresh checkout of PHP. You can choose either the 5_1 or 5_2 branches, both work fine:

$ cvs -d login
$ cvs -d co -r PHP_5_2 php-src
Now, you need to compile and install it:
$ cd php-src
$ ./buildconf
$ ./configure --prefix=/opt/php5_2 --disable-cgi
$ make
$ su
$ make install
$ echo >> /opt/php5_2/lib/php.ini
$ /opt/php5_2/bin/php-config --extension-dir | xargs echo 'extension_dir=' >> /opt/php5_2/lib/php.ini

Now, let's checkout and install PHP-GTK 2:

$ cd ..
$ cvs -d co php-gtk
$ cd php-gtk
$ ./buildconf --with-phpize=/opt/php5_2/bin/phpize
$ ./configure --with-php-config=/opt/php5_2/bin/php-config
$ make
$ make install

You might want to create a link to the new php executable:

$ ln -s /opt/php5_2/bin/php /usr/bin/php-gtk
That's it, you're done!

If you decide to 'add-on' PHP-GTK 2 to your existing PHP installation, ensure that your version of PHP is at least 5.1 with CLI enabled. PHP-GTK 2 will NOT work with any other versions of PHP. You can check your PHP version by typing php -v on the command line. Don't forget to check if the word cli appears in the output!

Now, checkout the latest CVS source of PHP-GTK 2, or download the Alpha source tarball, as per instructions on the PHP-GTK 2 download page. cd into the checked out / extracted directory, and execute the following:

$ ./buildconf
$ ./configure
$ make
$ make install

This should just work for most people. However, if there are multiple installations of PHP in your machine or you have installed PHP in some exotic location, you might face trouble. Most of these cases can be solved by specifying the exact locations of the phpize and php-config files:

$ ./buildconf --with-phpize=/path/to/phpize
$ ./configure --with-php-config=/path/to/php-config

User Contributed Notes
add a note about notes
There are no user contributed notes for this page.

previousInstallation on Windows
Installation on Mac OS Xnext

Last updated: Sun, 12 May 2013
view this page in English


PHP  Copyright © 2001-2015 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:01 2013 CEST