Adding fdftk to php under debian

Written by jeremy on October 18, 2007

Since there is not an easy step by step howto for adding features to packages I decided to write a quick and dirty one myself. this is also for reference if I ever need it later. Read more to see what I did….

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Debian Build from source:

– Download source packages
apt-get source *packagename*

– Change any config rules
vi *packagename directory*/debian/rules

– Download build dependencies
apt-get build-dep *packagename*

– Compile the package
apt-get -b source *packagename*

– Install it
dpkg -i *packagename*.deb

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Adding fdf support to php5-5.2.0:

Download source directory:
apt-get source php5

Download fdftk:
wget http://download.macromedia.com/pub/developer/acrobat/FDFToolkitForUnix.tar.gz

Extract fdftk:
tar xzf FDFToolkitForUnix.tar.gz

Copy files to /usr/local/:
cp "FDFToolkitForUnix/Headers and Libraries/Headers/*" /usr/local/include
cp "FDFToolkitForUnix/Headers and Libraries/LINUX/*" /usr/local/lib

Edit rules file php5-5.2.0/debian/rules and add under COMMON_CONFIG –with-fdftk=/usr/local Make sure you put a \ after the last configure line before the fdftk line

--with-exec-dir=/usr/lib/php5/libexec \
--with-fdftk=/usr/local

Install the newly compiled deb files:
dpkg -i *.deb

References:
http://www.debian.org/doc/FAQ/ch-pkg_basics.en.html
http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html
http://us3.php.net/fdf
http://www.adobe.com/devnet/acrobat/fdftoolkit.html

Posted Under: debian, linux, php

About jeremy

6 responses to “Adding fdftk to php under debian”

  1. jeremy says:

    Here are the steps I did:

    cd /usr/src
    apt-get build-dep php5
    apt-get source php5
    wget http://download.macromedia.com.....nix.tar.gz
    tar xzf FDFToolkitForUnix.tar.gz
    cp FDFToolkitForUnix/Headers\ and\ Libraries/Headers/* /usr/local/include/
    cp FDFToolkitForUnix/Headers\ and\ Libraries/LINUX/* /usr/local/lib/
    nano php5-5.2.6.dfsg.1/debian/rules
    **I changed lines 109 and 110 to
    –with-system-tzdata \
    –with-fdftk=/usr/local
    apt-get -b source php5

    It compiled successfully. I tested this on Ubuntu-Server 9.04 _Jaunty Jackalope_ – Release i386 (20090421.1)

  2. […] Not usable with php-5.2.x Some suggestions here for adding fdf support to php-5.2.x : http://jheslop.com/2007/10/18/adding…-under-debian/ […]

  3. Joe Strahm says:

    Hello, I am trying to install php5 with fdftk support on a debian box(2.6.32-5-amd64).

    When I completed the following steps succefully, I created a test.php file with this line of code:

    $test = fdf_create();

    But, the browser displayed the error “Fatal error: Call to undefined function fdf_create()”

    Here are the steps I followed:

    $: cd /usr/src
    $: wget http://download.macromedia.com.....nix.tar.gz
    $: tar -xaf FDFToolkitForUnix.tar.gz
    $: cp FDFToolkitForUnix/Headers and Libraries/Headers/* /usr/local/include/
    $: cp FDFToolkitForUnix/Headers and Libraries/LINUX/* /usr/local/lib/
    $: apt-get source php5
    $: apt-get build-dep php5
    $: cd php5-5.3.3/debian

    Opened up the file rules in a text editor
    under the COMMON_CONFIG add this line
    –with-fdftk=/usr/local
    Opened up file setup-mysql.sh
    Edit this line:
    $mysqld > $datadir/run.log 2>&1 &
    With this line:
    $mysqld –user=root > $datadir/run.log 2>&1 &

    $: apt-get –b source php5
    $: dpkg –i .deb

    could it be the version of php5 I am using? or do you know of anything else that might help?

    Thank you!

    • jeremy says:

      I would make sure you have a \ at the end of the line before the –with-fdftk in the COMMON_CONFIG. Also you can test to see if fdf is installed correctly by outputting phpinfo() it will have fdf listed in the modules list.

      But I see you are using 5.3.3. It looks like fdf has moved to a PECL extension based on this page: http://www.php.net/manual/en/fdf.installation.php

      This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.3.0

      So you will have to install with the pecl command.

  4. Joe Strahm says:

    Thank you Jeremy for responding. I actually found a class to do what I need to do and so I don’t need to use the fdf methods from php…thank you again!