HomePHP Page 3 - Programming with PHP and GTK, Part 1
A Test Run - PHP
Have you ever thought of writing a PHP application for client side execution without having a web server present? Learn the basics of creating a front end for PHP using PHP-GTK.
Before we start learning how to write programs in PHP-GTK, let's run one of the test programs to see if our installation work. Let's run a program called hello.php, which is in the TEST folder. Go to the command prompt and head over to C:PHP4TEST. To run the program, you'll need to type in "php hello.php".
If your PHP-GTK installation is correct, you should see a new window pop up with a button which greeting Hello World!
You can click on the button to close the program. You'll notice that when you click on the button, before the program exits, it sends the output "Hello World" back to the command console. If you use echo and print functions in your program, the output goes to the command console instead of the GTK front-end. This feature can be tapped when you need to debug your programs:
C:>cdphp4test C:php4test>php hello.php Hello World !
C:php4test>_
Now you can try running the other programs in the test folder.