Home/Support/Support Forum/Does the ConnectCard for i.mx28 support PHP?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Does the ConnectCard for i.mx28 support PHP?

0 votes
I was looking to add PHP support to the BusyBox httpd or Cherokee web server. I have read some documention that states, both the httpd and Cherokee web servers offer PHP support out of the box. However, when attempting to access a simple test.php page, I am either given a 404 file not found or a 503 service not available. Does the i.mx28 support PHP and if so, does anyone have an example that shows how to add PHP support.
asked Jun 11, 2014 in Linux by one1six New to the Community (3 points)

Please log in or register to answer this question.

1 Answer

0 votes
Best answer
there is no php support out of the box however it can be added I believe to cherokee web server.
This app note is pretty old and is based older version of DEL, but the idea is still the same:
In Addition we added the PDF as a single file to the FTP server:
the latter is not the “complete app note”.

I’ve tried to build and run php-sqlite example and it works fine. I tested it with DEL 5.8 and ccwimx51 module. Highlighted are significant changes I had to make to the procedure to build successfully most recent version of php.

cd ./src

wget http://us2.php.net/get/php-5.4.0.tar.gz/from/us.php.net/mirror

tar xvfz php-5.4.0.tar.gz

cd php-5.4.0/

for ARM9/11 based targets:
export TOOLCHAIN_DIR=/usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/
export PATH=/usr/local/DigiEL-5.7/x-tools/arm-unknown-linux-uclibcgnueabi/bin:$PATH

For CorexA8 based targets (imx51 and imx53)
export TOOLCHAIN_DIR=/usr/local/DigiEL-5.8/x-tools/arm-cortex_a8-linux-gnueabi/
export PATH=/usr/local/DigiEL-5.8/x-tools/arm-cortex_a8-linux-gnueabi/bin:$PATH

export LDFLAGS=-ldl

CC=arm-linux-gcc ./configure --host=x86 --target=arm-linux --prefix=/usr --without-iconv --disable-xml --without-pear --disable-libxml --disable-dom --disable-simplexml --disable-xmlreader --disable-xmlwriter --without-pdo-sqlite --disable-phar

make HOSTCC=gcc CXX=arm-linux-c++ CC=arm-linux-gcc

I simplify further instructions and do not modify existing project permantly – I am just dumping installation in to existing prebuilt rootfs

make INSTALL_ROOT=/exports/nfsroot-ccwmx51js install

looks like we have to copy php-cgi manually:
cp ./src/php-5.4.0/sapi/cgi/php-cgi /exports/nfsroot-ccwmx51js/usr/bin/

next update /exports/nfsroot-ccwmx51js/etc/cherokee/cherokee.conf as described in the document (my file attached).

Copy sample php file int web server’s root:
cp ./src/php-5.4.0/ext/exif/test.php /exports/nfsroot-ccwmx51js/usr/share/www/
cp ./src/php-5.4.0/ext/exif/test.txt /exports/nfsroot-ccwmx51js/usr/share/www/

I also added the one in the appnote as test1.php:
leonidm@ubuntu:~/src$ cat /exports/nfsroot-ccwmx51js/usr/share/www/test1.php

<p>Date: <?php print(Date("r")); ?>
<p>Server Info: <?php phpinfo(); ?>

I then boot my target with “dboot linux tftp” and test the webserver and it seems to work just fine
answered Jun 11, 2014 by LeonidM Veteran of the Digi Community (4,411 points)
selected Jun 12, 2014 by one1six
Thank you for assistance.  With the added details and instructions you provided, I was able to compile and add PHP support to the Cherokee web server.