What Exactly PHP-GTK Is? How to Install PHP-GTK on Ubuntu 12.04?

Posted on the 02 March 2013 by Yogeshvashist98 @YogeshVashist98

Andrei Zmievski, the man behind PHP-GTK, created an amazing extension that enable to run PHP applications with GTK+ displayed user interface. Since its inception in 2001, this extension enjoys many contributors that allows to compatible with GTK+2 and PHP 5 under platforms like Mac OS, Linux, Windows, etc. Talking about GTK+, it is one of the effective libraries of components that used to create UI for operating desktop computer environments. GTK+ works with an intention to create UI for GIMP, which is one of the popular Open Source image editing programs, just look like to Adobe Photoshop.

After the release of GTK+, it soon becomes popular because of its user interface library for applications that run under Linux distributions, which is totally based on the Gnome desktop environment. GTK run on the peak of the glib object system library. One of the best things about GTK+ is that it makes object that allows excellent graphics in the independent platform. Hence, developer can easily create the user interfaces by using GTK+ that runs on various multiple platforms like Mac OS, Linux, Windows, etc.

Procedure to Install Ubuntu 12.04

PHP-GTK applications can easily work on the Windows due to its binaries available for users. The recent binary available on the PHP-GTK website is 2.0.1. User can have an option to down more up-to-date Windows binary for adding to the project “auroraesrose”. Developer/ user can only have to unzip and run to get enjoy various applications. For executing PHP unzipped folder, one should only do is make right-click on any PHP-GTK file. It wouldn’t be easy to install PHP-GTK on Ubuntu as it requires proper knowledge and skills. You will be on the right way, if you know how to use a Terminal window. Before installing it, one should have to install certain essential things that are:

  • Git-core that helps you to download PHP-GTK
  • For compiling modules, PHP5-dev is required. No PHP-GTK install without php5-dev.
  • Pecl-cairo
  • Subversion that helps to download Cairo extension using svn
  • Install libglade2-dev for loading external .glade files into your applications.

After installing all essential things, you have to move next step, which is of concatenate a few files. If you are not concatenate a few files back, it will create big problems while you are executing the. /configure commands and./buildconf before installing PHP-GTK. One should also have to install git as latest source for PHP-GTK. One should deal with problems of errors, if he/she is downloading PHP-GTK without installing some necessary above given dependencies. Error like “error: configure: error: PHP-GTK 2.x requires GLib 2.6.0 or higher” will be seen.

Steps for installation:

  • First of all, install the dependencies
  • In second step, you have to download pecl-cairo. One can find latest libtool.m4 in various files. One should have to concatenate these files back into the libtool before installing the PHP-GTK source. This procedure is only applied to Ubuntu. If you have another derivative or Ubuntu without compiled, you have to install PHP by your own. You can also check, if compiling and installing PHP-GTK work or not, if it works, then avoid third step and if not, then go for it.
  • In third step, you have to concatenate the files back into the libtool and then, download and install PHP-GTK.
  • Go for Fourth step and add the PHP-GTK and Cairo Extension to ‘Dynamic Extensions’.
  • At last, just execute the PHP-GTK demo application and enjoy PHP-GTK.

Hope, you will successfully install PHP-GTK in Ubuntu 12.04. if you are still facing any problem, you can also contact well-experienced PHP developers, who have great knowledge of custom PHP development.