Revisited: Building Cross Platform GUI Apps With PHP-GTK - Downloading and installing PHP-GTK (Page 3 of 10 )
As with all GPL licensed software, PHP-GTK is a completely free download. Visit http://gtk.php.net/download.php and choose the appropriate version of PHP-GTK that matches your operation system. At the time of writing this article, you could choose to download the source, windows binary, as well as the concurrent versions system (CVS) download.
Installing PHP-GTK for Windows
I'm running Windows 2000 with PHP-GTK, so I'll give you my overview of installing PHP-GTK on Windows. Firstly, make sure you're equipped with an unzipping program such as WinZip. Next, locate the directory where PHP is installed. If you installed PHP using the default options it will be c:\php4.
Extract all of the files in the downloaded zip file to a directory such as c:\temp. Copy all of the files from the php4 directory to your current PHP extensions directory, which can be found in your php.ini file (typically it's either the directory where you installed PHP, such as c:\php4, or the extensions directory of your PHP installation, such as c:\php4\extensions).
You'll notice a file called php_win.exe. This executable can be used to run PHP-GTK scripts by simply double clicking on them. Before continuing let's setup Windows so that our PHP-GTK scripts will be run automatically when we double click on them.
Double click on any PHP script on your computer. When the "Open With..." dialog appears, choose other and browse to c:\php4\php_win.exe. Make sure the "Always use this program" checkbox is ticked and click OK. You'll notice that all of your PHP files now have the PHP-GTK icon.
Anyhow, back to the installation. The contents of the winnt directory in your PHP-GTK download contains a php.ini file. If you don't have a php.ini file in your windows directory already (which is c:\windows for Windows 95 and 98 and c:\winnt for Windows NT, 2000 and XP), then copy that php.ini file there.
Next, copy all of the files from the winnt\system32 directory of your download to your Windows system directory, which is c:\windows\system for Windows 95 and 98 users and c:\winnt\system32 for Windows NT, 2000 and XP users.
Run sysedit (Start -> Run -> "sysedit") and add the following line to the end of your autoexec.bat file:
Lastly, copy the test directory to the same directory where PHP is installed. The test directory contains a couple of PHP-GTK scripts that demonstrate how to create and interact with the various PHP-GTK files. Change into the c:\php4\test directory and double click on hello.php. You should see a PHP-GTK window containing one button. If everything worked OK, then you've successfully installed PHP-GTK.
It might also be a good idea to restart Windows at this point.