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 ...
Asked
Active
Viewed 276 times
0
-
This question probably belongs to Programmers, I've mistakingly marked it as not constructive. Try to move it there please, thank you. – Madara's Ghost Nov 19 '11 at 19:26
-
1Why do you want to write your own web server? Can't you use apache or lighttpd or some other Web server that already exists? – Daren Chandisingh Nov 19 '11 at 19:28
-
well it's mostly for learning purposes ... thank you for your answers – user1055633 Nov 21 '11 at 12:43
1 Answers
1
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 and possibly the POST body. It's just important to invoke the php-cgi binary with the right environment parameters.
Also have a look at Nanoweb, an existing webserver in PHP. It comes with a mod_cgi
implementation.