Howto Compile PHP-Gtk2 for FreeBSD 6.1 (A Success Story!)
| From: | Ron Tarrant | Date: | Sat, 02 Sep 2006 21:19:26 +0000 |
| Subject: | Howto Compile PHP-Gtk2 for FreeBSD 6.1 (A Success Story!) | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7215@lists.php.net to get a copy of this message | ||
T’was a dark and stormy day, but I finally got PHP-Gtk2 to compile under FreeBSD 6.1… with a little cheating. Here is what I had to do:
PrerequisitesThere’s a long list of things that need to be installed before PHP-Gtk2 will compile. Some (maybe most) will already be installed on any FreeBSD 6.1 system with XWindows installed, but check to make sure you have all of these available:
1) atk-1.09 (or later)
2) autoconf 2.13
3) automake
4) bison
5) gcc (I used version 3.4.4, but other version probably work okay, too)
6) gmake (which becomes ‘make’ on the command line)
7) flex
8) m4
9) perl10) gzip 11) tar 12) gsed (which becomes ‘sed’ on the command line) 13) xhost 14) cairo (I’m not 100% sure on this one, but it won’t hurt) 15) fontconfig (from the “Installing on Mac OSX” doc) 16) freetype (same as above) 17) pango header files (/usr/ports/x11-toolkits/pango) 18) xorg-libraries 19) gtk2 (version 2.6 or better; I used 2.8) 20) php5-cli (make sure you don’t confuse this with php-cgi as I often do) 21) php5-pcre 22) cvs The other thing you’ll need—and this is the cheating bit—is access to a working installation of PHP-Gtk2 on a Linux system. We’ll get to that and the reason why in a moment.
Symbolic LinksThere are some symbolic links to make so all the php-gtk build scripts can find the right tools to work with, so do this: cd /usr/local/bin ln –s autoconf213 autoconf ln –s automake19 automake ln –s autoheader213 autoheader
Downloading the SourceNow you can download PHP-Gtk2 from cvs. First, go to where the working directory will reside and then connect to the repository: cd /usr/local/ cvs –d :pserver:cvsread@cvs.php.net:/repository login (respond to the password prompt with) phpfi cvs –d :pserver:cvsread@cvs.php.net:/repository co php-gtk
Pre-compile PreparationHere’s where you need access to a working installation of PHP-Gtk2 on a Linux system. For some reason that’s far beyond my ability to figure out at this point, none of the /gen_/ files in /(builddir)/ext/gtk+// are generated by the /(builddir)/generator/generator.php/ script. So I swiped the entire contents of this directory from my Linux box where I had previously done a compile of PHP-Gtk2. So, the steps I took were: Swipe the contents of: /opt/php-gtk/ext/gtk+/ from the Linux system and put them in: /usr/local/php-gtk/ext/gtk+/ Go to that directory and get rid of the .lo files: cd /usr/local/php-gtk/ext/gtk+/ rm *.lo
CompilingGet yourself back to the /(builddir/) level: cd /usr/local/php-gtk/ Now start the normal routine: ./buildconf --with-phpize=/usr/local/bin/phpize ./configure --with-php-config=/usr/local/bin/php-config make make install
Final StepNow edit the php.ini file: cd /usr/local/etc/ ee php.ini Add this line somewhere after where /extension_dir/ is defined: extension=php_gtk2.so And that’s it! You should now have a working installation of PHP-Gtk2 under FreeBSD 6.1. Take care and Happy Coding! -Ron T. PS: Please feel free to post this wherever you want, pass it around, and generally make it known to anyone who needs/wants it. I'm having a great day!