Popular Posts
Tools and Tips
Search
Tuesday, February 12. 2008
How to install PHP-GTK in Ubuntu 7.10
Just as described on their site,"PHP-GTK is an extension for the PHP programming language that implements language bindings for GTK+. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client-side cross-platform GUI applications."
Basically, it will allow you to use almost everything in the GTK+ API with PHP. If you don't already know what GTK+ is, GTK+ is an API for creating a graphical user interface, which also happens to be cross platform (Linux, Windows, and Mac.) Today we're going to cover installing PHP-GTK in Ubuntu 7.10 (Gutsy).
Alright, let's get down to business.
First thing we're going to do, if you haven't already at sometime or another, is install the build essentials. We can do this by opening a terminal (Applications->Accessories->Terminal) and typing
Next, we need to install the packages required to use GTK (and cvs, assuming you do not have it):
Now we're ready to grab the files we need. Let's go ahead and connect to the repository with cvs:
It will ask you for a password, just press enter. Now we'll checkout the files with cvs:
Once that's completed, we can switch to the php-gtk directory, using
Making sure to replace 'username' with your username, cd into it's directory. We're finally ready. Let's build php-gtk.
First buildconf,
Once that finishes, we can configure...
And make...
And lastly, make and install it.
Now we have php-gtk and everything we need installed, we need to include the PHP-GTK extension in our php.ini, using $anyeditor. I happen to like gedit.
About halfway down (or by searching/grepping for 'Extensions',) you can include the extension by using:
Once that's saved, we can restart apache and test out php-gtk. Let's go ahead and restart apache...
And once apache is restarted, we can see if PHP-GTK is ready using
As long as you get the confirmation-
You're ready to start writing client side desktop applications. You can check out the PHP-GTK Documentation or tutorials for some ideas on how to use it. Sometime in the near future, I'll be putting up some tutorials for PHP-GTK with some demos. Have an idea for a fun demo, or advice on using PHP-GTK? Leave a comment, I appreciate them all.
Setup
First thing we're going to do, if you haven't already at sometime or another, is install the build essentials. We can do this by opening a terminal (Applications->Accessories->Terminal) and typing
sudo apt-get install build-essentialNext, we need to install the packages required to use GTK (and cvs, assuming you do not have it):
sudo apt-get install php5-cli php5-dev php5-gd libgtk2.0-dev libglade2-dev cvsNow we're ready to grab the files we need. Let's go ahead and connect to the repository with cvs:
cvs -d :pserver:cvsread@cvs.php.net:/repository loginIt will ask you for a password, just press enter. Now we'll checkout the files with cvs:
cvs -d :pserver:cvsread@cvs.php.net:/repository co php-gtkOnce that's completed, we can switch to the php-gtk directory, using
cd /home/username/php-gtkMaking sure to replace 'username' with your username, cd into it's directory. We're finally ready. Let's build php-gtk.
Building and Installing
First buildconf,
./buildconfOnce that finishes, we can configure...
./configureAnd make...
makeAnd lastly, make and install it.
sudo make installNow we have php-gtk and everything we need installed, we need to include the PHP-GTK extension in our php.ini, using $anyeditor. I happen to like gedit.
sudo gedit /etc/php5/cli/php.iniAbout halfway down (or by searching/grepping for 'Extensions',) you can include the extension by using:
extension=php_gtk2.soOnce that's saved, we can restart apache and test out php-gtk. Let's go ahead and restart apache...
sudo /etc/init.d/apache2 restartTesting
And once apache is restarted, we can see if PHP-GTK is ready using
php -m | grep php-gtkAs long as you get the confirmation-
php-gtkYou're ready to start writing client side desktop applications. You can check out the PHP-GTK Documentation or tutorials for some ideas on how to use it. Sometime in the near future, I'll be putting up some tutorials for PHP-GTK with some demos. Have an idea for a fun demo, or advice on using PHP-GTK? Leave a comment, I appreciate them all.
Posted by Joey
in Articles, How to, Linux, News, PHP, Resources
at
04:04
| Comments (3)
| Trackbacks (0)
Trackbacks
Trackback specific URI for this entry
No Trackbacks

