Web server made in PHP

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  

What do you thuink about it?
Pretty good to be made with PHP
70%
 70%  [ 12 ]
It's okay, I guess
11%
 11%  [ 2 ]
It sucks more than you
5%
 5%  [ 1 ]
I don't care, since I have Abyss
11%
 11%  [ 2 ]
Total Votes : 17

Author Message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Sat Sep 02, 2006 8:17 pm    Post subject: Web server made in PHP Reply with quote

Just finnished writing a small web server written in PHP. It's a pretty good start if you want to know how web servers are working and if you're planning to build your own in the future.

This server is not multithreaded and can only serve a single user each time. It has a lot of limits, since I didn't really care to make a good server when there are so many other out there.

You can download it here.
If you just want to check out the source code, click here.


Last edited by cmxflash on Sat Sep 02, 2006 11:21 pm; edited 2 times in total
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3714
Location: USA, GA

PostPosted: Sat Sep 02, 2006 8:52 pm    Post subject: Reply with quote

I just disected your PHP code and figured out some of it alread. I will post my
web server after I'm done. Let's see who has the best. lol
_________________
Computer Programmer & Networking Specialist

Back to top View user's profile Send private message Visit poster's website MSN Messenger
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Sat Sep 02, 2006 9:57 pm    Post subject: Reply with quote

Just remember to inactivate the updates. If you change even a single byte in my code and have the update system turned on, the source will be reloaded from my server.

Right now this server does now support subdirs or directory listing. I will probably add it when I feel like it (or when I'm just bored in math class). The main reason why I disabled usage of subdirs is because of security reasons. This server also fails on serving really big files.

*Edit
I've added some comments in the source code. They will be downloaded automatically the next time the server starts.
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3714
Location: USA, GA

PostPosted: Sun Sep 03, 2006 4:13 pm    Post subject: Reply with quote

I've just got done coding my Web Server in PHP. Mine supports sub directories
and all of Abyss Web Server's MIME Types. I added the Content-Length header
so that the files download at the right size. Enjoy!

P.S. It also supports spaces in the URL, so "Your File.zip" will also download.

NewB HTTP Server [2.13 MB]
http://files.trustabyss.com/newb_http_server.zip

cmxflash,

You need to set "Content-Length", and more MIME Types. Feel free to copy the
MIME Types from my PHP Server. You should also use urldecode() function, that
way you can support white spaces in the file names.

Sincerely, TRUSTAbyss
_________________
Computer Programmer & Networking Specialist

Back to top View user's profile Send private message Visit poster's website MSN Messenger
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Wed Sep 06, 2006 9:04 am    Post subject: Reply with quote

Just one question to you both since I'm too lazy yet to download and try out your packages. Does your php webserver process CGI (like PHP processing) requests?
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.
Back to top View user's profile Send private message Visit poster's website
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Wed Sep 06, 2006 11:24 am    Post subject: Reply with quote

loloyd wrote:
Just one question to you both since I'm too lazy yet to download and try out your packages. Does your php webserver process CGI (like PHP processing) requests?


That could be done pretty easy with shell_exec. However, neigher of our servers supports it.
Back to top View user's profile Send private message
loloyd
-


Joined: 03 Mar 2006
Posts: 435
Location: Philippines

PostPosted: Thu Sep 07, 2006 2:44 am    Post subject: Reply with quote

Hmm... I guess it's easy enough to run a script. The problem I'm thinking of is on passing the GET parameters or POST content-entity body, along with HTTP variables and optional environment variables, capturing the STDOut results and pushing this information back to the socket. Anyways, I'm not adept at PHP - but you see, I am developing my own auxiliary webserver as well on another language and these are my challenges - on CGI.
_________________

http://home.loloyd.com/ is online if the logo graphic at left is showing.
Back to top View user's profile Send private message Visit poster's website
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Sat Sep 09, 2006 9:41 pm    Post subject: Reply with quote

Added PHP support in my web server. It uses shell_exec to run the same php.exe as the main server uses.

If you have the old version of my server, it will update next time you start it. Otherwise, a download-link is avaliable on the top of this page.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group