When you’ve got Installer.app installed on your iPod Touch you’ll notice that it allows you to install Apache and a number of scripting languages (PHP, Perl, Python, Ruby).
That’s all well and good but getting it to run in on that local Apache install is another thing. Just managed to get it to work with PHP 5.2.3 so just follow along if you’re in the same situation:
1. Edit /etc/profile and update the line setting PATH to read as follows:
PATH="/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin:/opt/iphone/bin"
2. Edit /etc/httpd/httpd.conf and add the following to the end of the file:
ScriptAlias /php /opt/iphone/bin
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi"2. Restart Apache by SSH’ing to the iPod Touch and running the following command:
apachectl restart
Now put your PHP files into the webroot (/Library/WebServer/Documents/) and access them by pointing Safari to http://127.0.0.1/<path_to_your_file>.php
I’m yet to try it with Perl and Ruby but that should just be a matter of adding another ScriptAlias to httpd.conf of your local Apache install. Enjoy!
Related posts:
- iPod Touch 1.1.1 opened up
- iPhone App Reviews – AIR application
- Flex Builder 2 – Ant support
- AIR LiveBlogger beta 1
- Flash Lite running on the iPhone



I solved my problem. I couldnt find any repo which has the PHP and apache packages. But, I needed to install them nonetheless (since this was a part of some project work I am doing in my univ).
So, I downgraded my iPod touch from 2.1 to first 1.1.5 (to 1.1.4 later on) and installed not only apache & php, but right now, I even have MySQL and even Drupal running on my iPod touch.
I faced lots of difficulties through my way, installing all of them. So, I am willing to help anyone who needs help with installing Apache/php/mysql/drupal on ipod/iphone [the only pre-requisite (atleast as of now) is that a downgrade is necessary (to 1.1.5/1.1.4)]. My email is novemberain27[AT]gmail[DOT]com.
Regards,