Home arrow PHP arrow Page 3 - Revisited: Building Cross Platform GUI Apps With PHP-GTK

Revisited: Building Cross Platform GUI Apps With PHP-GTK

PHP is not just a web-based scripting language. Did you know that you can also build complete, cross-platform, windowed applications with PHP and MySQL? If not, read on...

Author Info:
By: Mitchell Harper
Rating: 5 stars5 stars5 stars5 stars5 stars / 19
November 17, 2002
  1. · Revisited: Building Cross Platform GUI Apps With PHP-GTK
  2. · What is PHP-GTK?
  3. · Downloading and installing PHP-GTK
  4. · Installing PHP-GTK for Linux
  5. · Building our first PHP-GTK app
  6. · Registering multiple callback functions
  7. · Adding GTK widgets to our window
  8. · Other PHP-GTK widgets
  9. · A PHP-GTK database app
  10. · Conclusion

print this article

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.
blog comments powered by Disqus

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials