Monday, April 28, 2008

What's New in PHP 5 !!!

"The best way to be ready for the future is to invent it" (John Sculley).

Introduction

Only time will tell if the PHP 5 release will be as successful as the releases of its two predecessors (PHP 3 and PHP 4). The new features and changes aim to rid PHP of any weaknesses it may have had and make sure that it stays in the lead as the best web scripting language on the globe.

This book covers PHP 5 and its new features in great detail. However, for those of you familiar with PHP 4, and are eager to know what is new in PHP 5, then this chapter is for you.

The chapter will cover:

* The new language features
* News concerning PHP extensions
* Other noteworthy changes

Language Features
New Object Oriented model

When Zeev Suraski added the object-oriented syntax back in the days of PHP 3, it was added as "syntactic sugar for accessing collections". The object-oriented model also had support for inheritance and allowed a class (and object) to aggregate both methods and properties, but not much more. When Zeev and Andi rewrote the scripting engine for PHP 4, it was a completely new engine, running much faster, much more stable and with many more features. However, the object-oriented model first introduced in PHP 3, was barely touched.

Although the object model had serious limitations it was used extensively around the world, often in very large PHP applications. This impressive use of the OOP paradigm with PHP 4 despite its weaknesses led to it being the main focus for the PHP 5 release.

So what were some of the limitations in PHP 3 and 4? The biggest limitation (which led to further limitations) was the fact that the copy semantics of objects were the same as for native types. So how did this actually affect the PHP developer? When you'd assign a variable (that points to an object) to another variable, a copy of the object would be created. Not only did this impact performance but it usually also lead to obscure behavior and bugs in PHP 4 applications because many developers thought that both variables would be pointing at the same object which wasn't the case. They were pointing at separate copies of the same object, changing one would not change the other.

For example:
class Person {
var $name;
function getName() {
return $this->name;
}
function setName($name) {
$this->name = $name;
}
function Person($name) {
$this->setName($name);
}
}

function changeName($person, $name) {
$person->setName($name);
}

$person = new Person("Andi");
changeName($person, "Stig");
print $person->getName();

In PHP 4, this piece of code would print out "Andi". The reason is that we pass the object $person to the changeName() function by-value, and thus, $person is copied and changeName() works on a copy of $person.

This behavior is not very intuitive, as many developers would expect the Java-like behavior. In Java variables actually hold a handle (or pointers) to the object, and therefore, when it is copied only the handle and not the entire object is duplicated.
There were two kinds of users in PHP 4, the ones who were aware of this problem and the ones who weren't. The latter would usually not notice this problem and their code was written in a way where it didn't really matter if the problem existed or not. Surely some of these people had sleepless nights trying to track down weird bugs which they couldn't pinpoint. The former group dealt with this problem by always passing and assigning objects by reference. This would prevent the engine from copying their objects but would be quite a headache as the code included numerous & signs.

The old object model not only led to the above-mentioned problems but also led to fundamental problems that prevented implementing some additional features on top of the existing object model.

In PHP 5, the infrastructure of the object model was rewritten to work with object handles. Unless you explicitly clone an object by using the clone keyword you will never create behind the scene duplicates of your objects. In PHP 5, there is neither a need to pass objects by reference nor assigning them by reference.

Note: Passing by reference and assigning by reference is still supported, in case you want to actually change a variable's content (whether object or other type).
New Object Oriented Features

The new object oriented features are too numerous to give a detailed description in this section. The object oriented language chapter goes over each feature in detail.

The following is a list of the main new features:
1. public/private/protected access modifiers for methods and properties

Allows the use of common OO access modifiers to control access to methods and properties.
class MyClass {
private $id = 18;

public function getId() {
return $this->id;
}
}
2. Unified constructor name __construct()

Instead of the constructor being the name of the class, it should now be declared as __construct(), making it easier to shift classes inside class hierarchies.
class MyClass {
function __construct() {
print "Inside constructor";
}
}
3. Object destructor support by defining a __destructor() method

Allows defining a destructor function that runs when an object is destroyed.

class MyClass {
function __destruct() {
print "Destroying object";
}
}

?>
4. Interfaces

Gives the ability for a class to fulfill more than one is-a relationships. A class can inherit from one class only but may implement as many interfaces as it wants.
interface Display {
function display();
}

class Circle implements Display {
function display() {
print "Displaying circle ";
}
}
5. instanceof operator

Language level support for is-a relationship checking. The PHP 4 is_a() function is now deprecated.
if ($obj instance of Circle) {
print '$obj is a Circle';
}
6. final methods

The final keyword allows you to mark methods so that an inheriting class can't overload them.
class MyClass {
final function getBaseClassName() {
return __CLASS__;
}
}
7. final classes

After declaring a class as final, it can't be inherited. The following example would error out:
final class FinalClass {
}

class BogusClass extends FinalClass {
}
8. Explicit object cloning

In order to clone an object you have to use the clone keyword. You may declare a __clone() method which will be called during the clone process (after the properties have been copied from the original object).
class MyClass {
function __clone() {
print "Object is being cloned";
}
}
$obj = new MyClass();
clone $obj;
9. Class constants

Classes definitions can now include constant values, and are referenced using the class.
class MyClass {
const SUCCESS = "Success";
const FAILURE = "Failure";
}
print MyClass::SUCCESS;
10. Static members

Classes definitions can now include static members (properties), accessible via the class. Common usage of static members is in the Singleton pattern.
class Singleton {
static private $instance = NULL;

private function __construct() {
}

static public function getInstance() {
if (self::$instance == NULL) {
self::$instance = new Singleton();
}
return self::$instance;
}
}
11. Static methods

You can now define methods as static allowing them to be called from non-object context. Static methods don't define the $this variable as they aren't bound to any specific object.

class MyClass {
static function helloWorld() {
print "Hello, world";
}
}
MyClass::helloWorld();

?>
12. abstract classes

A class may be declared as abstract so as to prevent it from being instantiated. However, you may inherit from an abstract class.
abstract class MyBaseClass {
function display() {
print "Default display routine being called";
}
}
13. abstract methods

A method may be declared as abstract, thereby deferring its definition to an inheriting class. A class that includes abstract methods must be declared as abstract.
abstract class MyBaseClass {
abstract function display();
}
14. Class type hints

Function declarations may include class type hints for their parameters. If the functions are called with an incorrect class type an error occurs.
function expectsMyClass(MyClass $obj) {

}
15. Support for dereferencing objects which are returned from methods.

In PHP 4, you could not directly dereference objects which are returned from methods. You would have to first assign the object to a dummy variable and then dereference it.
PHP 4:
$dummy = $obj->method();
$dummy->method2();

PHP 5:
$obj->method()->method2();
16. Iterators

PHP 5 allows both PHP classes and PHP extension classes to implement an Iterator interface. Once you implement this interface you will be able to iterate instances of the class by using the foreach() language construct.
$obj = new MyIteratorImplementation();
foreach ($obj as $value) {
print "$value";
}

For a more complete example, please refer to the "Advanced OOP & Design Patterns" chapter.
17. __autoload()

Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class). In PHP 5, this is no longer necessary. You may define an __autoload() function which is automatically called in case you are trying to use a class which hasn't been defined yet. By calling this function the scripting engine is giving a last chance to load the class before PHP bails out with an error.
function __autoload($class_name) {
include_once($class_name . "php");
}

$obj = new MyClass1();
$obj2 = new MyClass2();
Other New Language Features
1. Exception handling

PHP 5 adds the ability for the well known try/throw/catch structured exception handling paradigm. You are only allowed to throw objects which inherit from the Exception class.
class SQLException extends Exception {
public $problem;
function __construct($problem) {
$this->problem = $problem;
}
}

try {
...
throw new SQLException("Couldn't connect to database");
...
} catch (SQLException $e) {
print "Caught an SQLException with problem $obj->problem";
} catch (Exception $e) {
print "Caught unrecognized exception";
}

Currently for backwards compatibility purposes most internal functions do not throw exceptions. However, new extensions are making use of this capability and you can use it in your own source code. Also, similar to the already existing set_error_handler() you may use set_exception_handler() to catch an unhandled exception before the script terminates.
2. foreach with references

In PHP 4, you could not iterate through an array and modify its values. PHP 5 supports this by allowing you to mark the foreach() loop with the & (reference) sign, thus making any values you change affect the array you're iterating over.
foreach ($array as &$value) {
if ($value === "NULL") {
$value = NULL;
}
}
3. default values for by-reference parameters

In PHP 4, default values could only be given to parameters which are passed by-value. Giving default values to by-reference parameters is now supported.
function my_func(&$arg = null) {
if ($arg === NULL) {
print '$arg is empty';
}
}
my_func();
General PHP changes
XML and Web Services

Following the changes in the language, the XML updates in PHP 5 are most probably the most significant and exciting. The enhanced XML functionality in PHP 5 puts it on par with other web technologies in some areas and overtakes them in others.
The Foundation

XML support in PHP 4 was implemented using a variety of underlying XML libraries. SAX support was implemented using the old Expat library, XSLT was implemented using the Sablotron library (or using libxml2 via the DOM extension) and DOM was implemented using the more powerful libxml2 library by the GNOME project.

Using a variety of libraries did not make PHP 4 excel when it came to XML support. Maintenance was poor, new XML standards weren't always supported, performance wasn't as good as it could have been, and interoperability between the varies XML extensions did not exist.

In PHP 5, all XML extensions have been rewritten to use the superb libxml2 XML toolkit (http://www.xmlsoft.org/). It is a very feature rich, highly maintained and efficient implementation of the XML standards bringing the cutting edge of XML technology to PHP.
All the above mentioned extensions (SAX, DOM and XSLT) now use libxml2 including the new additional extensions SimpleXML and SOAP.
SAX

As mentioned, the new SAX implementation has switched from using Expat to libxml2. Although the new extension should be compatible there may be some small subtle differences. Developers who still want to work with the Expat library can do so by configuring and building PHP accordingly (not recommended).
DOM

Although DOM support in PHP 4 was also based on the libxml2 library, it was quite buggy, had memory leaks and the API in many cases was not W3C compliant. The DOM extension went through a thorough facelift for PHP 5. Not only was the extension mostly rewritten it is now also W3C complaint. For example, function names now use studlyCaps as described by the W3C standard making it easier for you to read general W3C documentation and implementing what you learnt, right away in PHP. In addition, the DOM extension now supports three kinds of schemas for XML validation, DTD, XML Schema and RelaxNG.

As a result of these changes PHP 4 code using DOM will not always run in PHP 5. However, in most cases adjusting the function names to the new standard will probably do the trick.
XSLT

In PHP 4, there were two extensions that supported XSL Transformations. The first was using the Sablotron extension and the second was using the XSLT support in the DOM extension. In PHP 5, a new XSL extension was written and, as mentioned, is based on the libxml2 extension. As in PHP 5, the XSL Transformation does not take the XSLT stylesheet as a parameter but depends on the DOM extension to load it, the stylesheet can be cached in memory and may be applied to many documents saving execution time
SimpleXML

Probably when looking back in a year or two it will be clear that SimpleXML has revolutionized the way PHP developers work with XML files. SimpleXML could really be called "XML for Dummies". Instead of having to deal with DOM or even worse SAX, SimpleXML represents your XML file as a native PHP object. You can read, write or iterate over your XML file with ease accessing elements and attributes.

Consider the following XML file:


John Doe
87234838


Janet Smith
72384329



The following piece of code prints each client's name and account number:
$clients = simplexml_load_file('clients.xml');
foreach ($clients->client as $client) {
print "$client->name has account number $client->account_number ";
}

It's obvious how simple SimpleXML really is.

And in case there is something advanced you need to do to your SimpleXML object which isn't supported in this lightweight extension, you can convert it to a DOM tree by calling dom_import_simplexml(), manipulate it in DOM and covert it back to SimpleXML using simplexml_import_dom(). Thanks to both extensions using the same underlying XML library switching between these two has been made a reality.
SOAP

Official native SOAP support in PHP 4 was lacking. The most commonly used SOAP implementation was PEAR's but as it was implemented entirely in PHP it could not perform as well as a built-in C extension. Other available C extensions never reached stability and wide adoption and, therefore, were not included in the main PHP 5 distribution.

SOAP support in PHP 5 was completely rewritten as a C extension and, although it was only completed at a very late stage in the beta process, it was incooperated into the default distribution due to its thorough implementation of most of the SOAP standard.

The following calls SomeFunction() defined in a WSDL file:
$client = new SoapClient("some.wsdl");
$client->SomeFunction($a, $b, $c);
New MySQLi (MySQL Improved) extension

For PHP 5, MySQL AB (http://www.mysql.com) has written a new MySQL extension that allows you to take full advantage of the new functionality in MySQL 4.1 and later. As opposed to the old MySQL extension, the new one gives you both a functional and an object oriented interface so that you can choose what you prefer. New features supported by this extension include prepared statements and variable binding, SSL and compressed connections, transaction control, replication support and more...
SQLite extension

Support for SQLite (http://www.sqlite.org) was first introduced in the PHP 4.3.x series. It is an embedded SQL library which does not require an SQL server and is very suitable for applications which don't require the scalability of SQL servers or if you're deploying at an ISP who doesn't give you access to an SQL server. Contrary to what its name implies SQLite is very feature rich and supports transactions, sub-selects, views and large DB files. It is mentioned here as a PHP 5 feature because it was introduced so late in the PHP 4 series and as it takes advantage of PHP 5 by providing an object oriented interface and supporting iterators.
Tidy extension

PHP 5 includes support for the useful Tidy (http://tidy.sf.net/) library. It allows PHP developers to parse, diagnose, clean and repair HTML documents. The Tidy extension supports both a functional and an object oriented interface, and it's API uses the PHP 5 exception mechanism.
Perl extension

Although not bundled in the default PHP 5 package, the Perl extension allows you to call Perl scripts, use Perl objects and use other Perl functionality natively from within PHP. This new extension sits within the PECL (PHP Extension Community Library) repository a http://pecl.php.net/package/perl.
Other New Things in PHP 5:
New memory manager

The Zend Engine features a new memory manager. The two main advantages are better support for multi-threaded environments (allocations don't need to do any mutual exclusion locks) and after each request freeing the allocated memory blocks is much more efficient. As this is an underlying infra-structure change you will not notice it directly as the end-user.
Dropped support for Windows 95

Running PHP on the Windows 95 platform is not supported anymore due to it not supporting functionality which PHP uses. As Microsoft has officially stopped supporting it over a year ago the PHP development community decided that this is a wise decision.
Summary

You must surely be impressed by the amount of improvements in PHP 5. As mentioned earlier, this chapter doesn't cover all of the improvements but only the main ones. Other improvements include additional features, a lot of bug fixes and very much improved infrastructure. The following chapters will cover PHP 5 and will give you in-depth coverage of the mentioned new features and others which were omitted.

America's 10 Best Cities To Live In And How They Stack Up For PHP Developers

RankCity, StateAverage PHP SalaryCost of
Living Index
1Fort Collins, CO$42,00099
2Naperville, IL $64,000115.2 *
3Sugar Land, TX$61,00087.2 *
4Columbia/Ellicott City, MD$71,000 110.3 *
5Cary, NC$59,00097.2 *
6Overland Park, KS$50,00080.5 *
7Scottsdale, AZ$50,000 107.8 *
8Boise, ID$36,00089.7
9Fairfield, CT$66,000163.4 *
10Eden Prairie, MN$53,000113.9 *
* = Index from closest listed city.

Tim Bray Explains Why Solaris is a Good Choice for PHP Developers

In lieu of actual background research about Mr. Bray, let me just give you the opening paragraph of his wikipedia page.

Timothy William Bray is a software developer, writer, major contributor to the XML and Atom web standards, and an entrepreneur (he co-founded Open Text Corporation and Antarctica Systems). Currently, Tim is the Director of Web Technologies at Sun Microsystems and resides in Vancouver, British Columbia, Canada.

Tim will be at ZendCon this year participating in a panel discussion titled “How Do The Stacks Stack Up?” I talked with Tim by phone because I was curious why PHP developers should consider Solaris as a development and deployment environment. Here’s what Tim had to say.

Tim, what, in your opinion, makes Solaris a good platform for PHP developers?
I would say there are three main points that make Solaris a good platform for PHP developers to work on. The first one would be observability. Any successful web facing application will eventually hit some performance bottlenecks. The dtrace technology that is in Solaris really seems to set a new standard for being able to instrument a running application to get a good understanding of what is going on in there.

The second thing I’d mention is the virtualization stuff. Solaris comes with very good virtualization support. It has the notion of zones so that you can run multiple virtual instances in an easily managed way. I think this is beneficial for a lot of developers.

The third thing that makes Solaris a good platform for PHP development is ZFS. A lot of PHP applications are data intensive and storage intensive. The is a lot of data flying to and from the storage device. ZFS is the filesystem that comes with Solaris and it has some really outstanding performance characteristics and safety features that are very important when dealing with high IO volume applications.

I think those three things make Solaris a really good deployment platform for PHP.

If you want more information or you want to see how your favorite development stack, stacks up against the others, join us at ZendCon.

=C=

Zend Certification for PHP 5: It's OFFICIAL!

Nothing in Silicon Valley is official until the press release has been circulated. Here is the complete press release.

=C=
——-

ZEND TECHNOLOGIES ANNOUNCES PHP 5 CERTIFICATION

CUPERTINO, CA – September 12, 2006 – Zend Technologies, Inc., the PHP company, today announced the availability of Zend PHP Certification for PHP 5, enabling developers to test and certify their expertise in new areas such as object oriented PHP programming, creating and using web-services with PHP, as well as PHP security.

“We see broad adoption of PHP 5.x as the preferred version of PHP for professional software development,” said Andi Gutmans, co-founder and Vice President, Technology at Zend Technologies. “We support this trend with updates to all of our tools to include full support for PHP 5. Upgrading our certification program is a logical next step.”

Introduced in July 2004, the Zend PHP Certification Program has become the industry standard certification for PHP. More than 1,500 software developers worldwide have passed the certification exam and can call themselves “Zend Certified Engineers”. By doing so, they have increased their professional opportunities in the PHP market. “The fact that I have become a Zend Certified Engineer has given me much more credibility in the workplace,” said Bob Carnaghi of Webpointmorpheus, a web design firm.

Zend PHP 5 Certification was the result of extensive communication with the Zend Certified Engineer community to determine how the program can be most useful for PHP developers. Some of the community’s top domain experts have contributed certification questions and reviewed the program to ensure that it is complete and tests for relevant skills. Becoming a Zend Certified Engineer gives developers an edge in today’s competitive technology market. Certification also helps enterprise management quickly qualify new hires, and keep current development teams knowledgeable about the latest technology.

With more than 3,500 test centers, developers around the globe can take the certification exam using specially configured computers. The certification is designed to test a developer’s level of PHP knowledge based on questions that reflect real-world scenarios. Specific topics covered include application design and theory, PHP basics, PHP 4/5 differences, as well as object-oriented PHP, security, XML and web services. Once a developer is certified for a specific version of PHP, the certification will never expire.

PHP is used in over 22 million web sites and continues to gain popularity. With the introduction of version 5, PHP has the scalability, robustness, integration and support for web standards to make it the perfect fit for creating and deploying modern web applications. These applications foster rich interaction and community, and are changing the way companies interact with their customers, suppliers and other stakeholders.

Zend PHP 5 Certification will be highlighted during the upcoming annual Zend/PHP Conference. At this conference, slated for October 31-November 2, 2006, attendees will be able to participate in Training and Certification sessions hosted by Zend. The program will also include daily keynote addresses, technical and business sessions, an exhibit hall, the Framework Pavilion, and evening networking activities.

Sunday, April 27, 2008

Using PHP on Sun Java System Web Server 7.0

Joe McCabe has posted an interesting article over on developers.sun.com about the various ways to get PHP up and running on “Sun Java System Web Server”. Here’s the opening section to wet your appetite.

PHP (PHP: Hypertext Preprocessor) is a widely used scripting language suited to creating dynamic web-based content. It is popular due to its simplicity, accessibility, wide number of available modules, and large number of freely available applications.

Sun Java System Web Server is a mature, highly scalable, and secure web server that provides process redundancy, request scalability, and a wide range of application programming interfaces (APIs) to create and serve dynamic content.

This document describes how to install and use PHP with Sun Java System Web Server (hereafter Web Server).

The article is broken down into the following 7 sections.

  • Understanding PHP and Web Server
  • Running the PHP Engine
  • Installing the PHP Engine as a CGI Program
  • Installing the PHP Engine as a FastCGI Server
  • Installing the PHP Engine as an NSAPI Plugin
  • Conclusion
  • References

This article is written for those who may be marginally familiar with Sun Java System Web Server but are new to PHP. It covers in details the steps necessary to get PHP up and running. There are tables comparing the pros and cons of each method of using PHP (CGI, FastCGI and Plugin) so that you can make an intelligent guess at which method is best for you before you start installing.

Joe concludes his tutorial with this quote.

The scalability of Sun Java System Web Server combined with the versatility of the PHP engine affords a high-performance web deployment platform for dynamic content. The combination delivers the stability required by the most demanding web sites and the versatility that an increasing number of web developers demand.

Developing Desktop Applications in PHP for Beginners.

Introduction:

We have been creating web-applications using PHP since it came into existence, now we can also develop Desktop or Stand alone Applications with PHP-GTK. Desktop Applications are one which does not need either a Web Server like IIS, Apache, PWS etc. or a web browser for their execution. One of the reasons why Java is so popular is because it can be used to build applications, web pages, applets and beans that can run on several platforms including Windows, Linux and Solaris. Java runs a virtual machine called JVM, and code is compiled into an intermediate format known as Java byte code, which is platform independent. When that particular piece of code is executed within the JVM, the JVM optimizes the code for the particular platform on which it is running as it is being compiled.

Microsoft's latest technology, .NET follows the same principles. Code is compiled into Microsoft Intermediate Language (MSIL) and is then executed within the .NET framework as an application domain. Microsoft is hoping to standardize C# and MSIL so that .NET code can run cross platform.

So what has all of this got to do with PHP-GTK? Well, both Java and .NET can be used to build windowed applications and web pages. Thanks to PHP-GTK, we can now build cross platform windowed applications with PHP as well.

What is PHP-GTK?

GTK is an acronym for the GIMP Toolkit and GIMP is an acronym for GNU Image Manipulation Program, and is a fully featured graphics editing program that runs on Linux. It has many (if not all) of the features of popular Windows programs such as Photoshop and Paint shop. It's the graphics editor of choice for most Linux users.

GTK is actually part of a set of libraries that was written in C called GTK+. GTK+ was built up over time and is now a main part of Gnome, which is a Linux GUI desktop environment. GTK+ is based on an object-oriented nature and also includes two other libraries:

  1. GLib: A library of tools that can be used to assist developers when creating applications with GTK+.
  2. GDK: Similar to GDI for Win32, GDK standard for GIMP drawing kit and wraps a set of lower level drawing functions into classes that make developing applications with GTK+ easier. If you're thinking along the lines of MFC for C++ then you're making a fair comparison: MFC wraps several controls and hides the calls to the underlying Windows API's from the developer. GDK does the same thing for GTK+.

Where to get?

We can download binary as well as source code version of PHP-GTK from http://gtk.php.net/download.php . As a beginner, it would be a difficult process to download and install in this manner. Where we need to set up another php.ini file for PHP-GTK. Instead there is another way of installing it. We can get PHP-GTK2 in an executable form as we get WAMP.EXE. (Windows, Apache, Mysql, PHP) All we have to do is just download just download the files from http://www.gnope.org/download.php ,unzip them and double click on the icon GnopeSetup-1.5.1.exe . It will run through a step by step process where it will set up PHP-GTK automatically.

How to test the installation?

Once the installation is done we would eager to know about what is special in it? When we install PHP we would run phpinfo () from root directory .For this let us run a sample script which displays Hello world (as usual) .we can use Dreamweaver for editing the code. Another important point to be kept in mind is to save the file with extension .phpw it can be saved anywhere on your hard disk.

Here is the sample code:

if (!class_exists('gtk')) {
die("Please load the php-gtk2 module in your php.ini\r\n");
}
$wnd = new GtkWindow();
$wnd->set_title('Hello world');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$lblHello = new GtkLabel("hello world");
$wnd->add($lblHello);
$wnd->show_all();
Gtk::main();
?>


I have saved this sample file with the name hello.phpw at c:\test\. We should run this sample code from command line interface. (CLI) There may be a question rising in your mind asking, why we should run through command prompt than by just by double clicking it as it is a stand alone application. It is possible, for that we need to have a PHP compiler which converts our PHP-GTK code to EXE file . For now, let us try running it from the command prompt.

Steps for Executing a sample code:

  1. Start -> Run -> cmd (for xp sp2 and later version) or command (for windows 98).
  2. Now you could see a black window which is Command Prompt. Key in the following commands as shown below.
  z:>c:
c:> cd test
c:\test>php hello.phpw

Once we finish this line and hit the Enter key, we should see the desired output.

This shows the successful installation of PHP-GTK2 and shouls us PHP output without a web-browser.

Some interesting Websites on PHP-GTK:
  1. http://www.kksou.com/php-gtk2/
  2. http://phpgtk.activeventure.com/gtk/gtk.gtkbox.html (describes about all base classes).
  3. http://gtk.php.net/download.php
  4. http://www.gnope.org/download.php