Installing 3rd party php extensions (ex. ioncube)

apps

#1

UPDATE: I solved it! This is how you load third party PHP extensions to the best of my knowledge.

I followed the instructions in the wiki to get my own php.ini file.
http://wiki.dreamhost.com/index.php/PHP.ini
It worked great!

Now I’d like to use my local php.ini file to load up one of my own php extensions. I chose the Suhosin Hardened-PHP extension at http://www.hardened-php.net/suhosin/index.html

I ran the following commands:
#> cd suhosin-0.9.16
#> phpize
#> ./configure
#> make
#> cp modules/suhosin.so /home/username/website/cgi-bin/

and I added the following line to the bottom of my php.ini update script:
echo ‘extension=“suhosin.so”’ >> $INIFILE

I fired up a phpinfo page and I don’t see suhosin loaded anywhere. I tried running ./php.cgi from a shell and see that suhosin gives the following error:
./php.cgi
PHP Warning: PHP Startup: Unable to load dynamic library ‘./suhosin.so’ - ./suhosin.so: undefined symbol: OnUpdateInt in Unknown on line 0

I probably need to recompile Suhosin with different options. I’m getting somewhere! Woo!


#2

I found out from the hardened-php forums that this happens because Suhosin is compiled against PHP4 but run on PHP5. These commands used the php4 libraries:
#> cd suhosin-0.9.16
#> phpize
#> ./configure
#> make

Can someone tell me how to make them use the php5 libraries?