|
Object Oriented PHP-GTK2 - Compile PHP-GTK on Unixesque Systems
Object Oriented PHP-GTK2 - Compile PHP-GTK on Unixesque Systems
|
||||
|
OOPS Site
Compile
Compile PHP-GTK on Unixesque SystemsHow to compile PHP-GTK from the source code. Topic: Compiling PHP-GTK2 (View All Tutorials) This document does not care about what distribution you use, these instructions will work on all shapes of Linux, FreeBSD, or Solaris. It is up to you to translate any line into the required line for your distribution. I will however tell you right now, if you are on Ubuntu and never done this before, you are missing pretty much every package you need. Actually, I lied. This document does care what OS you use. I cannot help you with Compiling on Windows. This post here on Elizabeth's blog might help you out though. Tested Systems:
Systems I plan to test:
Before you actually execute a command, check under the command example box for any distribution notes that might effect you. #1 Rule: Use your distributions package management utilties as much as possible, only compile when you absolutely have to. With the popularity of certain distributions I will make notes about what packages you might need to install.
RequirementsTo compile PHP-GTK you need several things:
Nearly all distributions will already have your Autotools and the Compile Tools already installed and setup right off the Installation CD, so chances are you can ignore #1 and #2. Installing these is far beyond the scope of this document, but they can usually be installed with your distribution package manager making your life easy. Be sure to install the development packages too.
Most modern distribution will have GTK+ 2.10 or newer installed, if you are using Gnome, XFCE, or any GTK applications then you have it. However you might not have the headers, and by that I mean development packages. You must have the development packages installed. If you compiled and installed GTK from source then you are done. If not scan your package manager, also install any Pango and ATK development packages if you see them.
PHP 5.2 or newer. If your package manager will allow you to install this without installing Apache, then you are in fact a winner. Distributions that over-modularize will probably require you to install several packages such as `php5`, `php5-gd`, and `php5-cli`. Install those three at least, and also the development package, probably named something like `php5-dev`. You will have to compile your own PHP if the version your distribution provides is older than 5.2.0, or does not provide any at all. Too many PHP-GTK applications depend on LibGlade, so you should install it because chances are you will eventually run into a program using it.
Install CVS if you do not have it already, because that is how we are going to get the PHP-GTK source. The CVS repository usually has fixes that are not yet out. One such is a problem with if your package had a separate package for PHP-GD like I said above. There is a fix for this in PHP-GTK which was added after the most recent release, I will update this document the next PHP-GTK release to reflect that change and hereby eliminiating this step.
Getting PHP-GTKYou need the source to compile it, so run these CVS commands: cvs -d :pserver:cvsread@cvs.php.net:/repository login <hit enter when it asks for a password> cvs -d :pserver:cvsread@cvs.php.net:/repository co php-gtk It will do it's thing, and after you have a new php-gtk directory. Change into that new directory.
Compiling PHP-GTKRun the command: ./buildconf
If this does not complete successfully then you are probably missing packages. A common error is 'unable to find phpize' and this means you did not install the PHP development package. After Buildconf, run the command: ./configure
The same rules apply here, if it fails to complete successfully you probably forgot to install some packages or their development counterpart packages. Scroll back up through the output to make sure it found LibGlade. checking for libglade support... yes checking for libglade-2.0 >= 2.4.0... yes You can still use PHP-GTK without this but when you download a program and it says 'unknown class: GladeXML' that is because you did not listen to me when I said to install LibGlade. So Configure finally completed successfully? Next, run the command: make
Wait for it... wait for it... did it complete successfully? It really should have, by now you should have fixed all the dependency problems. When that finishes (successfully) then you can run the command (as root): make install When that finishes, PHP-GTK is now installed. But hang on, you are not done yet.
Configure PHP and PHP-GTKWith PHP and PHP-GTK installed, you now need to configure PHP to work with GTK. Continue to the configuration document. Was this document helpful? I appreciate your feedback. i can has web two point ooh // copyright © 2007-2008 bob majdak jr
[ xhtml css | firefox ie7 opera ] |
||||