Arduino web server and PHP

Just a quick question,

Has anyone ever managed to get a stand-alone Arduino web server to serve up full PHP pages, or HTML pages that include PHP code.


echo "<h1>Hello World</h1>";
<p>That was PHP saying Hello World.</p>

Sure. They are just text.

The difficulty is only in the amount of memory available. With only 2K of RAM you have to keep the text stored somewhere else. Some people keep it in PROGMEM, others use a SD Card. The challenge with SD Card is it is cumbersome to transfer segments of the file (much less than 2K) from the SD Card to RAM to the Ethernet controller.

If you need your Arduino to serve up extensive web pages, maybe you need to look at a microprocessor oriented board.

I meant to ask if PHP scripts could work. Of course basic PHP text will.

For example, this PHP script prints out all files in it’s directory.

// open this directory 
$myDirectory = opendir(".");

// get each entry
while($entryName = readdir($myDirectory)) {
	$dirArray[] = $entryName;


// close directory

//	count elements in array
$indexCount	= count($dirArray);
Print ("$indexCount files

// sort 'em

// print 'em
print("<TABLE border=1 cellpadding=5 cellspacing=0 class=whitelinks>\n");
// loop through the array of files and print them all
for($index=0; $index < $indexCount; $index++) {
        if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
		print("<TR><TD><a href=\"$dirArray[$index]\">$dirArray[$index]</a></td>");

I know that can be done in the Arduino IDE, but this is about PHP scripts.
Also, the attached screen shot shows how the above code is rendered through an Arduino web server.

I think you're going to find it pretty difficult to write a PHP-interpreter that works in less than 2K of RAM.