Immediately the question arises, what is it for. And the answer immediately: just indulge. But as 2 use cases:
1) Carry a website that is always with you to show someone.
2) Software development for the iPhone itself in conjunction with PhoneGap. PhoneGap is an SDK for developing applications on JS using an accelerometer, GEO location, etc. That is, instead of Objective C, we can use JavaScript. And AJAX. And PHP / Python / Ruby.
It will be uncut PHP, with one exception: in the form of a DBMS, only sqlite can be used here (including via PDO).
Here is what it will look like in the end:

And another thing: along with PHP, you can install Python and Ruby. And here it is not far to Django (I don’t know about ROR).
Let's start the installation.First you need an iPhone with firmware 2.2.1 (this is the last one at the moment) and Wi-Fi on a computer / laptop.
1. First, you must perform the
unlock procedure of the
phone with the installation of Cydia.
2. Install OpenSSH via Cydia. Now we can connect to the phone via ssh and sftp. I use
putty and
FileZilla for this purpose.
3. Connect to the phone via ssh. Password "alpine" (skier in German), install PHP and lighttpd (apt-get install php lighttpd), but this can be done via Cydia. Create directories / var / log / lighttpd and / var / www (mkdir / var / log / lighttpd && mkdir / var / www)
4. You need to create a configuration file. You can use vim / mcedit (I think it is clear how to install) from the console, and you can fill it with sftp.
The config should be named /etc/lighttpd.conf, the config itself is
here .
5. Run lighttpd. To do this, run the command lighttpd-angel -f /etc/lighttpd.conf
6. To kill a demon, you must perform killall lighttpd
7. It is possible to automate the start / stop of the server through BossPrefs, then the console will not be needed. And you can install MobileTerminal and steer the console directly from your phone.

On iPhone,
WordPress has taken root with a
plugin for sqlite . Only you have to do a small patch: add the line “function mysql_connect () {return null; } "