Warning: PHP will not work if your foxboard OS is compiled with
uClibc, only with glibc.


download libjpeg, libpng and zlib.
initialize your SDK
        . init_env
extract them in the apps folder.
start with zlib:
        ./configure -shared
after configuring, you have to replace the words "gcc" and "ld" with
"gcc_cris" and "cris_ld"
in the files libtool and Makefile. Also put in the first line of Makefile:
        include $(AXIS_TOP_DIR/tools/build/Rules.axis
compile it.
        make cris-axis-linux-gnu
        make

if everything is working, you should have some libz.so* files.

do the same with libpng and libjpeg, except that you have to
./configure -s or something
(./configure --help , how to build a shared lib)

I explain how I do it (maybe someone other can do it better).

You have to install PHP and the libs on a usb pen drive. So think
about where you mount it.
If you mount the pendrive on /mnt/1 on the foxboard, you also have to
make a folder /mnt/1 on your SDK machine.
later you only need the lib folder on your pendrive.
~change to the apps folder (you have to change the paths anyway)

        mkdir /mnt/1
        mkdir /mnt/1/include
        mkdir /mnt/1/lib
        cp libpng/.libs/*.so* /mnt/1/lib
        cp libpng/*.h /mnt/1/include
        cp libjpeg/.libs/*.so* /mnt/1/lib
        cp libjpeg/*.h /mnt/1/include
        cp libz/*.so* /mnt/1/lib
        cp /libz/*.h /mnt/1/include


now you have all the libraries you need.

download the latest version of PHP from the PHP webseite, www.php.net

download the file phppatch from the acmesystems website,
http://www.acmesystems.it/articles/00026/phppatch

compile your php with the following options (I suggest to make a file,
phpconfigure):

        #!/bin/sh

        ./configure \
         --disable-libxml --disable-dom --disable-simplexml --disable-xml
--without-iconv \
         --with-sqlite --disable-xmlreader --disable-xmlwriter --with-gd \
         --without-pear\
         --with-zlib-dir=/mnt/1  \
         --with-jpeg-dir=/mnt/1\
         --with-png-dir=/mnt/1 \
         --enable-sqlite-utf8




run the file
        $ ./phpconfigure
run the patch
        $ ./phppatch
compile it!
        $ make cris-axis-linux-gnu
        $ make
strip the binary
        $ cris-strip sapi/cgi/php
transfer it to the foxboard
        $ scp sapi/cgi/php [EMAIL PROTECTED]:/mnt/1/
        $ scp php.ini-recommended [EMAIL PROTECTED]:/mnt/1/php.ini
set the +x rights on the foxboard
if you have your website on /mnt/1/web, you have to change the line
        doc_root = /mnt/1/web
in the php.ini file, and change/add the lines
        DocumentRoot /mnt/1/web
        CGIPath /bin:/sbin:/mnt/1
        AddType application/x-httpd-cgi php
        in the /etc/httpd/conf/boa.conf file.

restart the webserver:
        /etc/init.d/httpd restart
and everything should work fine.


-- 
MfG
Ernst Mayerhofer

Reply via email to