The uClinux distribution needed is 20040218 (because of uClibc 0.9.26).
Download the following files :
extract boa and php tarballs into the
directory, then apply the patch as follow:
cd path_to_boa_subdir; zcat path_to_boa_patch_file | patch -p1 cd path_to_php_subdir; zcat path_to_php_patch_file | patch -p1
Note that boa is not modified in any way for php, the patch provided for boa is to make it run on uClinux, it may be used without php.
manually add the the necessary config option to compile php (in
uClinux-dist/user/Makefile), boa should already be defined
in those files.
add boa and php package in the build then compile a new image.
php binary needs to be installed into the cgi-bin
/home/httpd/cgi-bin (the makefile is taking care
boa.conf is installed in
/etc, the previous
installation of boa might have placed this file in
/home/httpd, if one is present in this directory, boa will
not use it.
The default docroot for uClinux is
/home/httpd, if you
place a page
index.php in this directory, you need to prefix
the uri with
/cgi-bin/php to have php process this page.
A simple php hello world example would be:
<html> <head> <title>Test PHP</title> </head> <body> <?php echo '<p>Hello world !</p>'; ?> </body> </html>
copy this to
/home/httpd/index.php in your romfs image.
To call this page, enter this url in your browser :
I have not yet tried to make boa recognize the
extension, but using a specific mime type for cgi, boa is able to process
.cgi page outside
/cgi-bin so I guess it should
Here is some PHP scripts that run fine with this port, they have been
modified to take into account the cgi environment: the variable
PHP_SELF is usually used to refer to the script itself, but
in a CGI environment, one should use
Generally changes are needed because the script url differ from the
script name by the prefix
/cgi-bin/php/, this prefix is
mandatory for all the php page url.
Download this tar file and unpack it
into your docroot directory on the board fle system, then call
/cgi-bin/php/index.php to try the examples.
To build the first version of PHP (the old PHP 4.3.4 patch) for uClinux, I did
disable all optional features (
In the second version (PHP 4.3.10 patch) only some features have been
disabled, because of the lack of the corresponding libraries, the
configure command was:
./configure --disable-mysql --disable-xml
--disable-pear --disable-ipv6 this makes this version a lot more
To compile your own PHP version, the process would be:
./configurewith the options you need
php_config.hfile, it is generated by the configure script
php_config.hif needed to disable missing functions, compile again until you get a result...