Use jailbroken iPhone as webserver I know that this already has an answer, it is outdated. I am running iOS 10.3.3 on an iPhone 5 (so its 32 bit), and I want to run a web server for no reason at all. I have tried install lighttpd and php, but I can't find a way to turn it on.
Download ios-lighttpdphp-mysql from the repo https://cydia.angelxwind.net/ and turn on the server in settings. Then open 
http://localhost in Safari and your iPhone is now a webserver with PHP and mySQL.

This should work on all iOS versions and devices.

Source