How I create a web server that can interact with mobile applications?
Question: Ok first of all I want to create a web server that can interact with php,
Mysql or mango db and mobile applications. What do you think is better to use
Java or Python? I would like some good articles about web servers and how to
interact with php ... For example I managed to create an simple web server but
I don't know how to run php on it , and how can I make a mobile app to connect
on it... I would really appreciate some tips about these sort of things and
some good tutorials ...


Answer: You can use <http://pear.php.net/package/HTTP_Server> as webserver base.
Executing PHP within that is as simple as running a CGI interpreter. You need
the `php-cgi` binary and pass some [environment
variables](http://en.wikipedia.org/wiki/Common_Gateway_Interface) and possibly
the POST body. It's just important to [invoke the php-
cgi](http://stackoverflow.com/questions/7047426/call-php-from-virtual-custom-
web-server/7047581#7047581) binary with the right environment parameters.

Also have a look at [Nanoweb](http://nanoweb.si.kz/), an existing webserver in
PHP. It comes with a
[`mod_cgi`](http://nanoweb.sourcearchive.com/documentation/2.2.9/mod__cgi_8php-
source.html) implementation.

