Slashdot Mirror


phpstack - A TCP/IP Stack and Web Server in PHP

Adam Dunkels writes "Following the trend of writing 'inappropriate' programs in the PHP scripting language, I have written a small TCP/IP stack and a web server entirely in PHP. It is extremely stripped down: the IP stack only implements the most basic functionality required for running the web server and the web server cannot handle pages larger than 1.5k. Nevertheless, the stack is able to support an unlimited number of simultaneous TCP connections and the web server has support for PHP scripting. A live demonstration server is up and running the phpstack software."

295 comments

  1. Unlimited connections, really? by zeux · · Score: 5, Funny

    The server only allows very small HTML pages and pictures, but it is able to support an unlimited amount of simultaneous connections.

    You shouldn't have said that here. We are about to brute test this 'unlimited amount of simultaneous connections' thing.

    1. Re:Unlimited connections, really? by ernstp · · Score: 5, Funny

      Must Click Link To Experimental Webserver, Must Click...

    2. Re:Unlimited connections, really? by PugMajere · · Score: 2, Insightful

      Amazingly, it was still up when I posted this.

      Fairly slow, but still rather impressive.

    3. Re:Unlimited connections, really? by MesiahTaz · · Score: 1

      Eh, well it won't be "live" for long.

      --
      Are you an open source warrior?
    4. Re:Unlimited connections, really? by requim · · Score: 5, Funny
      You shouldn't have said that here. We are about to brute test this 'unlimited amount of simultaneous connections' thing.

      I believe that was his point (Why not have slashdot do your load testing..)
    5. Re:Unlimited connections, really? by gl4ss · · Score: 4, Funny

      "Read more about the phpstack on its home page:

      http://www.sics.se/~adam/phpstack/

      You are visitor number 3241 and your IP address is"

      thats part of the page I got.

      --
      world was created 5 seconds before this post as it is.
    6. Re:Unlimited connections, really? by y0bhgu0d · · Score: 1

      i was just visitor 4753
      it's still up.

    7. Re:Unlimited connections, really? by ultranova · · Score: 2, Interesting

      I was the visitor number 7532, and stiiilll goooiiinnggg!!!!

      Gotta admit, i'm impressed :). Even if the pictures don't ... wait, they just loaded. All of them. From a server in the middle of a slashdotting. Implemented in a scripting language.

      Now I'm impressed :).

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    8. Re:Unlimited connections, really? by Gherald · · Score: 2, Interesting

      and I'm #11651... kinda impressive, yeah.

      But I want to see them try doing this on a weekday at about 1pm EST =)

    9. Re:Unlimited connections, really? by Anonymous Coward · · Score: 0

      You are visitor number 16339 @ 1410 Pac time

    10. Re:Unlimited connections, really? by Anonymous Coward · · Score: 0

      Test Status: Unsuccessful

    11. Re:Unlimited connections, really? by ericspinder · · Score: 2, Informative

      I was # 20526, not bad, I even checked the server statics. Of course it only seems to show up those two pages.

      --
      The grass is only greener, if you don't take care of your own lawn.
    12. Re:Unlimited connections, really? by Anonymous Coward · · Score: 0

      You are visitor number 34032 @ 6:34 pacific time

    13. Re:Unlimited connections, really? by one4nine4two · · Score: 1

      It looks like the author of the server posted a Slashdot FAQ to answer questions posed here. Too bad it's not terribly informative and contains a lot of those generic "frequently asked questions" that no one would actually ever ask. Maybe it'll keep the Negative Nellies off his back though. Hint: He knows it's an extremely limited webserver.

    14. Re:Unlimited connections, really? by fprog · · Score: 0

      I was #40956, the server statistics are down and the images didn't show up neither (broken),
      but the main page still works, hey that's quite an exponential growth support. =)

      Pure Guess: Image made offline... for saving bandwidth?

  2. That is a VERY limited system.... by Anonymous Coward · · Score: 4, Informative

    ... the web server cannot handle pages larger than 1.5k

    Uhh, I guess that's one way to survive a slashdotting. :-)

    But, seriously, your demo doesn't even parse URLs; it is just hard-coded to send out a pre-written response on different ports:

    http://193.10.67.151:8080/ -- Main page
    http://193.10.67.151:8081/ -- Picture of a computer
    http://193.10.67.151:8082/ -- PHP Powered logo
    http://193.10.67.151:8083/ -- Picture of some code
    http://193.10.67.151:8084/ -- Stats

    Combined with the 1.5KB limit, that seems rather half-baked to me.

    You are basically reading just enough of the TCP/IP info to get the source IP address and port, running a different script depending on which port, then packaging the output into a single TCP/IP packet destined for that IP address and sending them out over the network.

    I am rather sure the 1.5KB limit is because you didn't figure out how to deal with packet fragments, for example. So there's no way to raise that limit without rewriting the TCP/IP code. Not cool.

    1. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 2, Funny

      Another story about something being done in PHP that ends up not being quite as impressive as the headline led to believe?

    2. Re:That is a VERY limited system.... by Doppler00 · · Score: 4, Insightful

      Yeah, writing a web server is "inappropriate" languages is pretty easy. As long as you can send bytes out of a port, it's pretty easy.

      I once wrote a webserver for an industrial microcontroller using some obscure language called "optoscript". But at least I made sure that I only needed to connect to one port to access different pages.

    3. Re:That is a VERY limited system.... by jackshck · · Score: 4, Informative

      get over it man. it specificaly says

      this code is not meant to be taken too seriously, it is just a quick and dirty proof-of-concept hack written in about 3 hours.

      could you do better?

      --
      Charles Wyble All around tinkerer
    4. Re:That is a VERY limited system.... by igrp · · Score: 5, Insightful
      Hmm... To quote the server's main page:

      Welcome to the phpstack demo server! phpstack is a small TCP/IP stack and web server written in PHP. It is a quick and dirty proof-of-concept hack and shouldn't be taken too seriously.

      Well, it clearly says it's a PoC hack so why not cut this author some slack? To be perfectly honest, I think this is rather impressive in more than one way. Sure, this isn't exactly a novel idea but that wasn't the point. It clearly is a show of flexibility. Php wasn't designed with these kinds of applications in mind, yet it seems to handle this kind of stuff impressingly well.

      Also, it testifies to the fact that thinking outside the box is a good thing. I mean, come on, what would you rather see yet another mail client or some cool project that makes you go "hmm, how come I never thought of this"?

    5. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 5, Insightful

      Yeah, I wrote a quick and dirty proof of concept distributed object client/server in Python in about two hours, but I wouldn't post it to slashdot. Quick and dirty proofs of concepts are what progreammers do every day...so what?

    6. Re:That is a VERY limited system.... by nlh · · Score: 3, Insightful

      That is a typical obnoxious-geek response and should be modded as such.

      Before you call someone else's interesting project "half-baked" and point out that he "didn't figure out" things (implying that you, however, did), why don't you go post YOUR php-based TCP/IP stack and webserver that DOES deal with the issues you mentioned. Then, you can freely criticize his work as much as you'd like, pointing out the solutions instead of highlighting the problems.

      Until then, you should consider keeping comments like that to yourself.

    7. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 0, Redundant

      [i]...yet it seems to handle this kind of stuff impressingly well.[/i] ..you say as the page loading icon spins and spins and spins... :)

    8. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 2, Insightful

      could you do better?

      Yes. First, since I know TCP/IP, I would have designed around the 1.5KB limit initially, by ensuring that TCP/IP could actually send out multiple packets on one connection, rather than just one. And, second, I certainly would have it parsing URLs, for example. After all, we're talking PHP here, which has much of the string processing capabilities of Perl (preg_match, for instance). It's not a difficult for a good programmer.

    9. Re:That is a VERY limited system.... by aka-ed · · Score: 1
      Well I'm impressed, the thing is being /.'ed to hell but keeps ticking. I guess the quick redirect helps.

      But then, I'm impressed with myself just for knowing what "php" is an acronym for.

      --
      I survived the Dick Cheney Presidency 7 to 9 AM 7-21-07
    10. Re:That is a VERY limited system.... by Thomas+Charron · · Score: 4, Interesting

      Interesting concept..

      So, basically, you can ONLY critisize something if you managed to rip the idea and make your own..

      Ever written an OS?

      Wait. Have you ever written an automated bot to post slashdot comments? If no, then you must STFU, as you have not done it yourself..

      Shesh..

      --
      -- I'm the root of all that's evil, but you can call me cookie..
    11. Re:That is a VERY limited system.... by NoMercy · · Score: 1

      I'm sure you can write a TCP/IP stack in a turing machine, but why bother it's only vain attempts at glorifying a language which was perfectly fine in the area it was designed for.

    12. Re:That is a VERY limited system.... by Gyorg_Lavode · · Score: 1

      wait. you're admitting to letting a bot post comments for you? I'm not sure if it sais something about your comments or your opinion of the reader's intelligence that you consider a bot capable of speaking for you.

      --
      I do security
    13. Re:That is a VERY limited system.... by Fearless+Freep · · Score: 2, Interesting

      I'm sure you can write a TCP/IP stack in a turing machine, but why bother it's only vain attempts at glorifying a language which was perfectly fine in the area it was designed for.

      This is the kinda stuff programmers do all the time when they are bored or playing around or trying stuff out. I'm not surprised someone did it, I'm just surprised it was considered worth telling anyone about. It's about as newsworthy as posting your homework solutions

    14. Re:That is a VERY limited system.... by Saeed+al-Sahaf · · Score: 1

      It's not a "finished product", it's a concept demo.

      --
      "Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
    15. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      No, it doesn't make me go "hmm, how come I never thought of this." It makes me go "hmmmm, what sort of idiot hammers nails into the wall with the heel of his shoe when he's got a perfectly good hammer?" And your post makes me go "hmmm, what kind of idiot thinks that hammering nails with shoes is cool?"

      Php seems to be be replacing Perl as the halfwit's language of choice. A halfwit programmer is always monoligual and bent on "proving" the greatness of his language for everything because he has nothing else.

    16. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 2, Informative

      Well, it clearly says it's a PoC hack so why not cut this author some slack?

      Well, how about because how he tried to "trick" us into thinking it was a real webserver? Notice all the URLs on his site have fake pieces on the end to make them look like real URLs? http://193.10.67.151:8084/stats.php for instance. The stats.php bit is part of the deception.

      In fact, his "web" server doesn't case WHAT data is sent to those ports, valid URL request or not. As soon as a single packet is sent to it, it sends its one-packet reply. He's just lucky that most web browsers happen to fit their requests into one packet, and don't hang or give errors when the rest of the packets making up their request aren't properly acknowledged.

    17. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      I disagree. that post seemed to me like a valid technical critique. i learnt something from it anyway.

    18. Re:That is a VERY limited system.... by kervel · · Score: 1

      even for such a limited system, the claim that it was written in 3 hours surprised me a lot. I can imagine you can come up with the basic idea in 3 hours, but to write, setup (serial) and debug such a thing in 3 hours would require a level of talent i have never seen before ... if its true, wow

    19. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0


      Before you call someone else's interesting project "half-baked" and point out that he "didn't figure out" things (implying that you, however, did), why don't you go post YOUR php-based TCP/IP stack and webserver that DOES deal with the issues you mentioned. Then, you can freely criticize his work as much as you'd like, pointing out the solutions instead of highlighting the problems.


      RIGHT..

      So I can't criticize security flaws in a product because I didn't write a competing product myself.

      I can't criticize anybody for doing a piss poor job on something that I wouldn't do even when I have first hand evidence that it can be done better.

      What you're saying is that I need to attempt to write the command line userland of Windows 2000 in order to criticize it for not being as good as alternatives.

      Go try to suck your own cock buddy. That's about all you'll be able to achieve in life.

    20. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      http://nanoweb.si.kz/

      http://nanoftpd.sourceforge.net/

      http://daniel.lorch.cc/projects/phpserv/ (404'd)

      This guy ain't revolutionary.

    21. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      Aww... don't do that...
      I just installed Linux on that shoe. I even got the webserver running!

    22. Re:That is a VERY limited system.... by Thomas+Charron · · Score: 1

      Hehe, no. I'm saying that by his/her logic, you can't be a critic of a film if you haven't made your own..

      My Karma has ben in tact for years now, with a user ID near 1000..

      --
      -- I'm the root of all that's evil, but you can call me cookie..
    23. Re:That is a VERY limited system.... by Beale · · Score: 1

      Come on, someone write a webserver in BASIC.

    24. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      The idea is simple:

      Don't talk the talk if you've never walked the walk.

      And if you have, that's fucking great. Sit back down.

    25. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      Well, let's see it. You've got 3 hours.

    26. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      Nice. But I've actually got other, more productive things to do today. To wit, a real programming project I'm getting paid for, and a date this evening. Writing a PHP script that re-creates functionality already built into PHP is not high on my list of priorities. :-)

    27. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      ... would require a level of talent i have never seen before

      Uhh.

      Obviously, you have never met a good programmer.

      I could name a dozen people I work with who could do this, and actually make it a REAL web server, and not a FAKE web server (like this) that just sends a single (essentially pre-canned) packet in response to receiving a single packet on various ports.

      Seriously. Do not be impressed. There is nothing here. The sad thing is that it took the guy THREE HOURS to write it. Considering that it's neither a web server nor an actual TCP/IP stack--and knowing what it really does--30 minutes to an hour is a better estimate for someone who understands both PHP and the basics of the TCP and IP protocols.

    28. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      A real programmer would have forgotten about his date and taken that challenge.
      Even if the date was with a live woman.

    29. Re:That is a VERY limited system.... by JDWTopGuy · · Score: 1
      Okay, since BASIC isn't very standard, this is paraphrased from what I remember of old-school BASIC. This webserver is insecure and would have to be started from inetd or something like that. Furthermore, there's no way this complies with the HTTP RFC(s). I'm sure somebody will point out some place where I screwed up.
      10 INPUT "", $R
      13 $R = SUBSTR( $R, 5, STRLEN( $R ) )
      20 $F = "/var/www/htdocs" + $R
      30 ON ERROR GOTO 666
      40 OPEN $F AS #1 FOR READ
      41 PRINT "200 OK"
      43 PRINT "Content-type: text/html"
      46 PRINT ""
      50 ON ERROR GOTO 70
      60 INPUT #1, $L
      63 PRINT $L
      66 GOTO 60
      70 END

      666 PRINT "500 DAMNIT"
      676 PRINT "Content-type: text/plain"
      667 PRINT ""
      668 PRINT "Can't open."
      669 END
      --
      Ron Paul 2012
    30. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      OK, you're all hat and no cattle. Just what I figured.

    31. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0
      http://nanoweb.si.kz/

      The web server's the easy part. This has no TCP/IP stack.

      http://nanoftpd.sourceforge.net/

      FTP is a little harder to implement, but again no TCP stack

      http://daniel.lorch.cc/projects/phpserv/

      This isn't a server at all, just a framework to write a server.

      OK, Mr. All Hat and No Cattle, please give us a link to another TCP/IP stack written in PHP. Betcha you can't do it.

    32. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      Go back to talking out of your ass on the INTP list.

    33. Re:That is a VERY limited system.... by smittyoneeach · · Score: 1

      Beyond the tactical self-teaching value, I'm curious about the strategic value to F/OSS of something like this.

      At the risk of seeming to squash innovation, does this afford ammunition to the "no one fired for buying ___" community?

      Fragmentation helps the Monolithic Scylla...

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    34. Re:That is a VERY limited system.... by Uzik2 · · Score: 1

      Why does anyone need to rewrite the tcp/ip stack
      in php? Is it perhaps so they can have a worm
      that bypasses the firewall? Just what we need!
      Can't people find something more constructive
      to do with their time that to badly reinvent the
      old stuff to use for rotten things?

      --
      -- Programming with boost is like building a house with lego. It's a cool but I wouldn't want to live in it
    35. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      But he didn't WRITE a TCP/IP stack. Filling in the destination IP in a pre-written TCP packet is NOT a stack. His "TCP/IP stack" doesn't even allow you to view the contents of incoming packets, and only lets you send a SINGLE packet in response to a connection. How is that a "stack?!?"

      Didn't you read the original post?

    36. Re:That is a VERY limited system.... by batkiwi · · Score: 1

      He's not the one who accepted it to the front page, though, so why blame him?

      He did it and thought it was "cool," submitted the story, and the wonderful slashdot editors staff posted it.

    37. Re:That is a VERY limited system.... by sg_oneill · · Score: 2, Interesting

      I think its damn cool myself.

      So what if theres a page name being passed back. Compliance perhaps? Eh. Its a finishing touch or an unfinished feature.

      Get over it! Its the TCP stack that makes this baby interesting.

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
    38. Re:That is a VERY limited system.... by edgarde · · Score: 1

      Seems like an excellent use for Slashdot. There should be a "Hammer my server" Topic.

    39. Re:That is a VERY limited system.... by Lehk228 · · Score: 1

      oh, like that wouldn't get abused at all....

      --
      Snowden and Manning are heroes.
    40. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      OK, yeah, I just got back from the date....

      Turns out I wouldn't have missed out on much had I stayed home and written a PHP webserver instead. :-) Live and learn, I guess. ;-)

    41. Re:That is a VERY limited system.... by NuclearDog · · Score: 0

      That is all true, but my guess is this guy wrote this for lack of better things to do, and thought "Hmm, this is something nobody has really done before... who would appreciate the value of this... Slashdot! and I can have it load tested at the same time!" This probably wasn't something planned out beforehand.

      ND

      --
      This statement is forty-five characters long.
    42. Re:That is a VERY limited system.... by fatphil · · Score: 1

      Don't be a fool!

      Don't you realise that means he's running _5_ web servers off this thing. Surely that's 5 times as impressive!

      FP.

      --
      Also FatPhil on SoylentNews, id 863
    43. Re:That is a VERY limited system.... by fbjon · · Score: 2, Funny

      What? You have my homework solutions?

      Post Immediately!

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    44. Re:That is a VERY limited system.... by Anonymous Coward · · Score: 0

      I'm sorry that the date didn't work out. Good luck next time! The best date I've had so far didn't work out--but we're close friends to this day. I guess people use Slashdot to let out their frustrations.

      I'm actually quite dissapointed with the community here. What kind of idiot moderator moderates up the kind of people who criticize other's work?

      I used to have an account with a four-digit ID number. There's a reason I closed that account.

  3. Ouch by Pikhq · · Score: 2, Interesting

    The thing has a hit counter, currently at 200. 2,000,000 anyone?

    --
    echo "rm -rf ~/* ; echo "echo "Exit" ; exit" > ~/.bashrc ; exit" > ~user/.bashrc
    1. Re:Ouch by Anonymous Coward · · Score: 0

      519 now - wonder how long it'll take? :)

    2. Re:Ouch by Anonymous Coward · · Score: 0

      You are visitor number 710 and your IP address is .....

    3. Re:Ouch by Anonymous Coward · · Score: 0

      You are visitor number 1220 and your IP address is .....

      this thing is coping quite well

    4. Re:Ouch by hob42 · · Score: 1

      Visitor 1125... few hundred per minute, not too bad.

    5. Re:Ouch by Anonymous Coward · · Score: 0

      You are visitor number 1389 and your IP address is .....

      ok thats the last time i'm gonna refresh it lol

      but this last time it appeared to have a stylesheet which I couldnt get the other times.

      also the pictures are not downloading.

    6. Re:Ouch by jx100 · · Score: 5, Funny

      "You are visitor number 1339"

      dammit, if I was only 2 users earlier...

    7. Re:Ouch by bigberk · · Score: 1

      Still live at:
      You are visitor number 5143

      That's not bad. Slow to load, but live!

    8. Re:Ouch by MoonBuggy · · Score: 1

      About 5500 when I looked (can't remember exactly and not waiting for it to load again). Isn't the average Slashdotting something in the region of 45000, or did I just make that up?

    9. Re:Ouch by gl4ss · · Score: 1

      "You are visitor number 7179"

      the thing is, the server/stack basically just shoots back premade packets if you will(the 1.5kb limit is there for this design choice, no need to keep up connections and stuff).

      --
      world was created 5 seconds before this post as it is.
  4. Alright. by whiteranger99x · · Score: 5, Funny

    Ok everyone, get it out of your systems already! :P

    "whoa 2 comments and it's already slashdotted"
    "whoa dude, shouldn't have let slashdot post your server!"
    "Imagine a beowulf cluster of these guys"

    And i'm sure you can figure out more Slashdotisms people *smirks*

    Seems pretty cool at any rate

    --
    Join the TWIT army now!
    1. Re:Alright. by magefile · · Score: 1

      How about, "I bet he's running his server on it, too".

    2. Re:Alright. by Leffe · · Score: 2, Funny

      "Seems as if the demo server is running phpstack."

    3. Re:Alright. by Anonymous Coward · · Score: 0

      How about the "Slashdotism" of "Getting it out of your system..."?

    4. Re:Alright. by Anonymous Coward · · Score: 0

      Great. Now the new joke is pointing out all the other lame jokes in advance. What's..... next?

    5. Re:Alright. by menkhaura · · Score: 1

      You must be new here.

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
  5. ouch... by zoloto · · Score: 5, Funny

    unlimited number of simultaneous TCP connections

    To the tune of Queen:
    Another one bytes the dust!

    1. Re:ouch... by Sir_Real · · Score: 5, Funny

      Well... You really were asking for it...

      With apologies to the late F.M.

      Php is a scripting language
      not a layer three network stack
      Ain't no way your server won't break
      Unless you're sitting in a SONET node rack

      Are you crazy? Are you certified
      Your server is a molten heap
      Through the floor the slag still drips
      to the sound of the beep

      Chorus:
      Another one bytes the dust
      Another one bytes the dust
      And another one gone, and another one gone
      Another one bytes the dust
      Hey, I'm gonna slashdot you
      Another one bytes the dust

      How long till my router cacks
      after a weekend slashdot bitch smack
      I invested everything that I had
      even wrote a custom ip stack

      Are you crazy? Are you certified
      Your server is a molten heap
      Through the floor the slag still drips
      to the sound of the beep

      chorus

      There are plenty of ways you can hurt a host
      and bring it to its knees
      you can heat em
      you can drop em
      you can install bad ram
      and even try using Windows ME

      But you're batshit, yes out of your tree
      If you think your isp won't freak
      Through the floor your server melts
      To the sound of the beep

      chorus

    2. Re:ouch... by Anonymous Coward · · Score: 0

      There is a special place in hell reserved for pop song parody authors. You'll be roasting slowly on a spit next to Weird Al for eternity.

    3. Re:ouch... by paragmas · · Score: 1

      Hah.. I'll show you all how old I am. We used to take Queens, Another one bytes the dust (ironic words for Slashdot), and reverse the tape in our cassete players so we could here the backmasked version, which says, 'it's fun to smoke marijuana', prooving Queen was pure evil!!!

    4. Re:ouch... by Anonymous Coward · · Score: 0

      Queen is Rock, not Pop, thank you very much.

    5. Re:ouch... by zoloto · · Score: 1

      Touche. Absolutely awesome.

    6. Re:ouch... by FauxPasIII · · Score: 1

      > You'll be roasting slowly on a spit next to Weird Al for eternity.

      Proving yet again why I don't want to go to heaven; all the interesting people aren't there !

      --
      25% Funny, 25% Insightful, 25% Informative, 25% Troll
    7. Re:ouch... by Anonymous Coward · · Score: 0

      ever heard of pop rock?

    8. Re:ouch... by Anonymous Coward · · Score: 0

      "With apologies to the late F.M."

      Another One Bites the Dust wasn't written by Freddie Mercury but by the band's bass player, John Deacon. If you're going to apologise to anyone it should be to him. I don't think you need to though, it's a pretty cool parody.

  6. /.ed by mp3LM · · Score: 0, Redundant

    ..you do realize you just /.ed yourself, right? But I must say...that is a nice accomplishment, I'll definetly learn a lot from looking at the script.

  7. test it for me by Anonymous Coward · · Score: 0

    Hey, I wrote this thing and want to see how it stacks up against, say, a Slashdot tide. It's kooky enough that they'll post it.

  8. Crashed already! by ejbvanc · · Score: 0, Redundant

    Unlimited my ass!

  9. Oh, you're gonna get it now by Saint+Aardvark · · Score: 0, Redundant
    "The server only allows very small HTML pages and pictures, but it is able to support an unlimited amount of simultaneous connections."

    Hey! He can't say that! Sic 'em!

  10. Need To Update The Story by BRock97 · · Score: 1, Redundant

    "A live demonstration server is up and running the phpstack software."

    to:

    "A live demonstration server was up and running the phpstack software."

    DAMN YOU SLASHDOT EFFECT!!!!!

    --

    Bryan R.
    The price of freedom is eternal vigilance, or $12.50 as seen on eBay.....
    1. Re:Need To Update The Story by Anonymous Coward · · Score: 0

      -5 redundant. you're late guy

    2. Re:Need To Update The Story by kekeruusperi · · Score: 0

      "A live demonstration server is up and running the phpstack software."

      Haha, I couldn't help but laugh out loud after reading this line. :)

  11. First thing that went through my mind by Oriumpor · · Score: 2, Informative

    I gotta see this... and low and behold it looks sllooooow but it came through.

    btw content below:
    The phpstack demo server

    Welcome to the phpstack demo server! phpstack is a small TCP/IP stack and web server written in PHP. It is a quick and dirty proof-of-concept hack and shouldn't be taken too seriously.

    The web pages and pictures on this page are served by the phpstack server. The server only allows very small HTML pages and pictures, but it is able to support an unlimited amount of simultaneous connections.

    Read more about the phpstack on its home page:

    http://www.sics.se/~adam/phpstack/

    You are visitor number 446 and your IP address is XX.XX.XX.XX.

    1. Re:First thing that went through my mind by Anonymous Coward · · Score: 0

      [image] The phpstack demo server

      Welcome to the phpstack demo server! phpstack is a small TCP/IP stack and web server written in PHP. It is a quick and dirty proof-of-concept hack and shouldn't be taken too seriously.

      [image]

      The web pages and pictures on this page are served by the phpstack server. The server only allows very small HTML pages and pictures, but it is able to support an unlimited amount of simultaneous connections.

      [image]

      Read more about the phpstack on its home page:

      http://www.sics.se/~adam/phpstack/

      You are visitor number 1263 and your IP address is 62.254.64.12.

      Server statistics.

      Â

  12. Due to the anticipation of the /. effect . . . by dgrgich · · Score: 5, Informative

    Here's a screenshot of the phpserver results. Pretty cool stuff.

    1. Re:Due to the anticipation of the /. effect . . . by requim · · Score: 1
      Here's a screenshot of the phpserver results. Pretty cool stuff
      Where are the Sim City logs when you need it?
  13. So much time... by Nom+du+Keyboard · · Score: 0, Flamebait

    Why is it that people with this much time and smarts on their hands aren't out curing cancer, making the world safe from terrorists, and/or defeating SCO/RIAA/inapproprate software patents? Heck, even finding the killer of OJ's wife would make for good news and worthwhile effort.

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
    1. Re:So much time... by B3ryllium · · Score: 1

      Outsourcing.

    2. Re:So much time... by Enrico+Pulatzo · · Score: 2, Insightful

      that's an easy one. Cancer doesn't come with documentation. One can flesh out an implementation of a spec, but figuring out the great unknown is quite a bit more difficult.

    3. Re:So much time... by applef00 · · Score: 2, Insightful

      Maybe his skills don't lie in research medicine, preemptive military strategy, and/or patent law. Heck, maybe not even in criminal investigation!

      Seriously, dude. This is Slashdot. While I agree that these (well, most of them) are worthwhile efforts, the simple fact is that most people on Slashdot are just looking for a little entertainment and escape from their day. We're geeks. We do geeky things.

      Get over it.

  14. A man with way too much free time by HBI · · Score: 2, Funny

    Between that C-64 based multitasking, multiplatform operating system with tcp/ip and a web server in it, and this...

    Dude, you need beer and chicks.

    --
    HBI's Law: Frequency of calling others Nazis is directly correlated with the likelihood of the accuser being Communist.
    1. Re:A man with way too much free time by whiteranger99x · · Score: 1

      Dude, you need beer and chicks.

      Haha, I second that notion. I would also like to nominate that guy who installed 36+ OSes on his machine. Sheesh, I'd need beers and chicks to calm me down after installing windows 2000 let alone other OSes. Oh and those guys that made C64s play movies should be on that list too.

      --
      Join the TWIT army now!
    2. Re:A man with way too much free time by Anonymous Coward · · Score: 0

      Doesn't everyone on slashdot?

  15. How..? by iantri · · Score: 2, Interesting
    Err.. I don't know anything about PHP so give me the benefit of the doubt.

    Is PHP able to be run standalone?

    I thought it was parsed by a webserver module when accessed?

    1. Re:How..? by ^Case^ · · Score: 3, Informative

      PHP has a CLI interpreter. You can run it just like you run perl or whatever.

    2. Re:How..? by Richard_at_work · · Score: 2, Informative

      There is now (since early 4.x versions) a command line version of PHP, for scripting purposes. All the benifits of mod_php in your scripts, and it is now installed by default along side the apache module. You can also acheive a similiar solution using the cgi binary.

    3. Re:How..? by MoonBuggy · · Score: 1

      As has been said, it can be run standalone. What I'd like to see, however, is phpstack running within Apache. Infact, the article says it's got support for PHP scripting - phpstack within phpstack within Apache, perhaps?

  16. Up and running by FattMattP · · Score: 0, Redundant
    A live demonstration server is up and running...
    Not anymore!
    --
    Prevent email address forgery. Publish SPF records for y
  17. I don't get it, really I don't by hawkbug · · Score: 0

    So... you need a webserver to host the php script that is a web server. So, you run a web server on top of a web server? I'm missing the point entirely, but then again people have done crazier things. I once knew a guy who wrote a C++ compiler for his TI-85 calculator - and then wrote a web server for it - and the managed to connect a 14.4 external modem up to it through the little serial port on the bottom. I was amazed - but at the same time, I had to wonder why he had nothing better to do with his time...

    1. Re:I don't get it, really I don't by iamsure · · Score: 1

      No.

      You can run php as a standalone executible, which then runs an ip stack.

    2. Re:I don't get it, really I don't by knitterb · · Score: 1

      Like Perl, PHP too can be run standalone.

      --
      -bk
    3. Re:I don't get it, really I don't by madstork2000 · · Score: 5, Informative

      PHP does not depend on a webserver to run. It can be executed standalone just fine. I use it that way as a PERL replacement. No need for flame wars, I do still use PERL , the PHP stuff is for "backend" scripts on my webservers that share some common custom PHP libraries I have written as part of web applications, in so doing I eliminated the need to reimplement a lot of logic in PERL...Anyway that was off topic, the point is PHP does NOT need a webserver to run.

      MS2k

    4. Re:I don't get it, really I don't by hawkbug · · Score: 1

      Wow, I was very unaware of that. That's very interesting. That makes these new php uses make a little more sense to me.

    5. Re:I don't get it, really I don't by Anonymous Coward · · Score: 0

      > I once knew a guy who wrote a C++ compiler for
      > his TI-85 calculator...

      Yeah, okay, was this over lunch or dinner. Why
      am I having a hard time believing this is true?

    6. Re:I don't get it, really I don't by hawkbug · · Score: 1

      I don't know why you are having a hard time - he was a brilliant man who also liked to run Quake on an SGI workstation that he picked up at an auction - I would guess it ran at a blazing 3fps, and he still could whup my ass. Here is a picture of his dorm room in 1997:

      http://www.fimble.com/jessmachines.jpg

      He died about 5 years go - if he hadn't, I would have him email you the source code that he was very proud of. I remember it ran under the Zshell, but that's all I can remember about it.

  18. fire fighting by Fullmetal+Edward · · Score: 0

    Now if only you can make a program to put out the flaming box that was the server :)

    --
    --- [Insert intresting Sig here]
  19. It's not down... it's just slow by binaryspiral · · Score: 1

    You are visitor number 1103.

    Just let it load in a different window while you read the rest of the headlines. It'll open, it's just dreadfully slow.

    HTTP requests 3279

  20. I For One... by IrresponsibleUseOfFr · · Score: 1

    would like welcome our inappropiate programming masters.

    Others may mock it's usefulness, and let's face it, this is not useful. But, I salute you for doing a project that has no practical use to anyone besides proving beyond a doubt to some nay-saying jerk that it can be done.

    --
    Facts are meaningless. You could use facts to prove anything that's even remotely true! -Homer Simpson
    1. Re:I For One... by binaryspiral · · Score: 2, Funny

      This was the cry of many editorials back in the 50's and 60's when the U.S. went to the moon. But where would we be without Velcro or pens that can write upside down?!

  21. PSHTTPD - PostScript webserver by Richard_L_James · · Score: 4, Interesting

    This php webserver reminds me of HTTPi a webserver written in 100% perl. Neither of which are that hard when you know. However Anders "Pugo" Karlsson wrote a webserver called PS HTTPD in postscript. Now that I found very impressive :)

    1. Re:PSHTTPD - PostScript webserver by Fearless+Freep · · Score: 1

      [i]Neither of which are that hard when you know.[i]

      Writing basic web servers in any languague is pretty easy, actually. Heck, I wrote a web server in Smalltalk that now powers ezboard.com. It's something a lot of programmers end up doing as a lark just to see that they can.

    2. Re:PSHTTPD - PostScript webserver by Jayfar · · Score: 1

      That could be more amusing were it running on a hacked up old PS printer, say maybe an Apple LaserWriter or some such - call it a LaserWeber.

    3. Re:PSHTTPD - PostScript webserver by Richard_L_James · · Score: 1
      Writing basic web servers in any languague is pretty easy

      Very true. Only some languages are a bit more difficult than others. Still for real quick and dirty 1 page efforts NetCat makes a great webserver ;)

    4. Re:PSHTTPD - PostScript webserver by Fearless+Freep · · Score: 1

      Very true. Only some languages are a bit more difficult than others

      True, I found that writing a webserver in Smalltalk (and an object server in Python) a lot easier than C, simply because the socket libraries in those languages hid a lot of the difficulty, and the string parsing was more sophisticated

    5. Re:PSHTTPD - PostScript webserver by ExoticMandibles · · Score: 1

      Not at all, mon ami. PostScript is a very real, very capable language. It's based on Forth but adds support for real types.

      Personally I'm more impressed that someone wrote a TCP/IP stack in PHP, but then I have a pretty low opinion of PHP.

    6. Re:PSHTTPD - PostScript webserver by InfiniteZero · · Score: 5, Funny

      What would be REALLY impressive is a webserver written in HTML.

    7. Re:PSHTTPD - PostScript webserver by Anonymous+Villain · · Score: 1

      I'd like to see someone write a tcp/ip stack in Cobol. Better yet write a working tcp/ip stack in a truly evil language from destined for Hell. A language designed as a programmers worst nightmare or programmers Hell. A language designed from the start to make easy things impossible and difficult things implausible.


      A really challenging test of programmer skill would be writing a tcp/ip stack in a difficult language. An example of a difficult programming lanuage would be in brainf*** or Intercal (

      http://www.catb.org/~esr/intercal/) or Malebolge or even Unlambda or Befunge or ILLGOL which is described as a mash of Perl with a dash or Fortran and some other dainties to make programming an internship in hell. Writing anything in these languages is akin to cyber insanity. It's a challenge to write anything in Intercal or it's brethren and a true test of skill to write a program tcp/ip stack in Intercal. These languages marry obfuscation with encryption and cuneiform. Some even reverse the logical flow of programs. And for some languages there is no logical flow.



      An example snippet of brainf*** from

      http://cydathria.com/bf/bf_ex1.html:

      An example of Unlambda code from the website
      http://www.eleves.ens.fr:8080/home/madore /programs /unlambda/

    8. Re:PSHTTPD - PostScript webserver by NuclearDog · · Score: 0

      Y'know, with all those exploits available in IE...

      ND

      --
      This statement is forty-five characters long.
    9. Re:PSHTTPD - PostScript webserver by Anonymous Coward · · Score: 0

      I don't know about HTML, but XSLT is supposedly turing complete...

  22. All I have to say... by whiteranger99x · · Score: 1

    is fucking wow.

    Granted it isn't wise for them to have slashdot checking out the web server all at once, I have to say that's pretty cool. Now im waiting for a webserver written in Flash (yes I am a demonic bastard >:)

    --
    Join the TWIT army now!
    1. Re:All I have to say... by Anonymous Coward · · Score: 0

      is fucking wow.

      Granted it isn't wise for them to have slashdot checking out the web server all at once, I have to say that's pretty cool. Now im waiting for a webserver written in Flash (yes I am a demonic bastard >:)


      ...me first... I'm a cute angel... I'm waiting for it to be available in ascii.

  23. the page... by blue-rabbit · · Score: 1

    The phpstack demo server Welcome to the phpstack demo server! phpstack is a small TCP/IP stack and web server written in PHP. It is a quick and dirty proof-of-concept hack and shouldn't be taken too seriously. The web pages and pictures on this page are served by the phpstack server. The server only allows very small HTML pages and pictures, but it is able to support an unlimited amount of simultaneous connections. Read more about the phpstack on its home page: http://www.sics.se/~adam/phpstack/ You are visitor number 1381 and your IP address is .... Server statistics.

  24. Nanoweb anyone ? by lonedfx · · Score: 4, Informative

    http://nanoweb.si.kz/

    Nanoweb is an HTTP server written in PHP, designed to be small, secure, and extensible.

    It is distributed under the terms of the GNU General Public License.

    Nanoweb's main features are :

    - HTTP/1.1 compliance
    - Powerful and easy configuration
    - Modular architecture
    - FastCGI, CGI and Server side includes support
    - Name and port based virtual hosts
    - Access control lists
    - htpasswd, MySQL, PostgreSQL and LDAP authentication support
    - Themes for server generated content
    - Apache compatible log format, MySQL logging
    - Directory browsing
    - inetd support and SSL via external helpers
    - Denial of Service protection
    - Proxy Server extension
    - Filters and gzip support
    - RBL support (mail-abuse.org)
    - Extension Protocols (request methods) support
    - ... and a lot more

    lone, dfx.

    1. Re:Nanoweb anyone ? by Bender_ · · Score: 4, Informative

      Nanoweb is an HTTP server written in PHP, ..

      Yes, but not TCP/IP stack.

    2. Re:Nanoweb anyone ? by DA-MAN · · Score: 1

      Finally a cross platform tcp/ip stack available for all to use . . . oh wait

      --
      Can I get an eye poke?
      Dog House Forum
    3. Re:Nanoweb anyone ? by Anonymous Coward · · Score: 0

      This "stack" shit just means that the inbred asshole that wrote it thinks it's l33t to fill out the header bytes himself

      WOW - you have issues..

    4. Re:Nanoweb anyone ? by Anonymous Coward · · Score: 0

      Oh, how I wish you hadn't posted that A/C so that I could add you to my "Friends" list! :-)

    5. Re:Nanoweb anyone ? by Tokerat · · Score: 4, Funny


      Yea, but does it support PHP? ;-)

      --
      CAn'T CompreHend SARcaSm?
    6. Re:Nanoweb anyone ? by mabinogi · · Score: 1

      Have you noticed how the same people that think this is a great achievement are the same ones who also compare PHP to Perl and even Java?

      --
      Advanced users are users too!
    7. Re:Nanoweb anyone ? by unixbum · · Score: 1
      Yea, but does it support PHP
      Actually yes it does, both as CGI and it has a experimental PHP Parser(written in itself) built in.
  25. ... unlimited ... by AchilleTalon · · Score: 2, Insightful
    "... to support an unlimited number of simultaneous TCP ..."
    Hey! Wake up, we are on /. and anyone here knows there is nothing unlimited in the universe, but human stupidity.

    --
    Achille Talon
    Hop!
    1. Re:... unlimited ... by mousse-man · · Score: 1
      At least when looking at this:

      The PC is a 450 MHz Pentium-III with 386 megabytes of memory running FreeBSD 4.9. The serial cable operates at 115200 bits per second and the web server is able to push approximately 5 connections per second.
      One suspects this won't hold up to the combined forces of ./ readership.
    2. Re:... unlimited ... by Digital11 · · Score: 1

      ...with 386 megabytes of memory...

      I think the fact that he has a computer that has 386MB of ram is a greater accomplishment than a web server & tcp/ip stack in PHP... 128 + 128 + 128 = 386? How strange... I was always under the impression that 128 * 3 is 384... :P

      --
      I am a leaf on the wind. Watch how I soar.
  26. Not crashed yet by Ohreally_factor · · Score: 2, Informative

    It's just really slow. I'm visitor 1853.

    --
    It's not offtopic, dumbass. It's orthogonal.
    1. Re:Not crashed yet by sumdumass · · Score: 1

      i'm 3302 and it was slow. i thought at first it was down but it all the sudden poped up. after waiting about 3 minutes for a refreash i am visitor number 4354.

      I would say that it is somewhat cool. Interestingly enough, i bet it is more his bandwidth that is slowing it down rather then his server..over 1000 hit in a couple minutes is quite a feat for a hacked together proof of concept toy.

    2. Re:Not crashed yet by ps_inkling · · Score: 1
      I was visitor 7712+-10.

    3. Re:Not crashed yet by Alsee · · Score: 1

      Wow, it's still up. I was visitor 10,258. Assuming you posted that right after seeing the page it works out to almost exactly 2 people served per second.

      -

      --
      - - You can't take something off the Internet! That's like trying to take pee out of a swimming pool.
  27. A live demonstration server is up... by Anonymous Coward · · Score: 0

    You mean was up...

    1. Re:A live demonstration server is up... by theguywhosaid · · Score: 2, Informative

      This guy is the greatest! its slow as crap, but its not down.

  28. inappropriate language by slickwillie · · Score: 1

    Nothing new here. I knew a guy who once wrote a mag tape driver in COBOL.

    1. Re:inappropriate language by Dachannien · · Score: 1

      COBOL: Unsafe at Any Speed

  29. cool! by Anonymous Coward · · Score: 2, Funny

    now we only have to port PHP to wristwatches and commodore 64s to get them on the net.

    1. Re:cool! by Anonymous Coward · · Score: 0

      Well... this is from the same person who wrote the contiki os (http://www.sics.se/~adam/contiki/) for the c64 so maybee it's not that far away.. ;) //fatal

  30. Waste... by beauzo · · Score: 1

    You're now not so sure loosing your "real" job was worth it?

  31. But can you do it in Crosstalk or Procomm script? by Secrity · · Score: 1

    This reminds me of the scripts that did silly things like playing chess using Procomm or Crosstalk scripts.

  32. Re:Hardly new.. by Bender_ · · Score: 4, Funny

    Yes, it is new. The difference is that it is not only a web server, but also an entire TCP/IP stack!

  33. Different window? by kendallemm · · Score: 5, Funny
    Just let it load in a different window while you read the rest of the headlines.

    This is slashdot. I think you meant "different tab" ;)

    KB
    1. Re:Different window? by binaryspiral · · Score: 1

      Ah, right - windows is a hard habit to kick, like cocaine... but causes more problems.

  34. MOD PARENT DOWN by TheRaven64 · · Score: 1

    None of the PHP scripts on the linked page are web servers, and none of them contain their own TCP/IP stack.

    --
    I am TheRaven on Soylent News
  35. Kudos by AC5398 · · Score: 1

    Nice!

  36. Why? by Billy+the+Mountain · · Score: 3, Funny

    I think I might know why. Unless I'm missing the boat here, this would lead to making a more efficient web server. If the IP stack, the web server and the dynamic HTML processing is all integrated into one program, it seems to me that you'd have one very efficient html-processing screamer.

    BTM

    --
    That was the turning point of my life--I went from negative zero to positive zero.
    1. Re:Why? by jfengel · · Score: 1

      Hey, look! Over there! It's the boat!

      In theory you could have been right, if you were writing in a compiled language: you convert everything into one string of machine instructions which can be optimized as a mass, rather than suffering some of the inefficiencies of a monolithic TCP and IP stack beneath your program that you can't optimize further. That sort of thing does actually happen on microcontrollers.

      However, PHP is a scripting language, so those optimizations don't get made. What could take a half-dozen machine instructions instead takes several hundred. Nothing against the language; it's far better than C for banging out web apps. Just not comms drivers.

      Further, TCP and IP as implemented in a kernel (whether Linux, MS, or OS/X) are optimized to within an inch of their lives, with zillions of programmers scrutinizing them. Those stacks are all written in C or even hand-optimized assembly. No matter how smart you are, you're going to have a hard time beating the performance of that code.

    2. Re:Why? by NuclearDog · · Score: 0

      Hey! There are no font tags on your 'steganographic' sig!

      ND

      --
      This statement is forty-five characters long.
  37. Bzzt! Wrong! by Anonymous Coward · · Score: 3, Insightful

    All of those results are web related applications, e.g. application servers. None are web servers except for Reptile, which is written in Python!

    1. Re:Bzzt! Wrong! by Anonymous Coward · · Score: 0

      A web server is easy. HTTP/0.9 can be done in like six lines of code (listen on a port, loop: get a connection, grab path out of the first line, send the file, goto loop).

      Most HTTP/1.0 implementations in scripty languages don't do much more than that, they just wait for a blank line to end the headers.

  38. thinking outside the box.. by Hooya · · Score: 1

    oye. not again. where's the box that you speak of? what box?

    the only thing that resembles a 'box', that i'm thinking inside of, is my house. i like to be inside it while i think; thank you very much.

  39. Should I know about this PHP? by Latent+Heat · · Score: 2, Interesting
    Strictly talking scripting languages, I have heard about Perl being good for text rearranging but being a little heavy on the non-letter characters, I have hacked out some VB script to do stuff under Windows, and I have experimented with Python. I have even heard about Ruby being popular among OO purists.

    Is this PHP thing something I should know about? I Googled for it and it seems more proprietary than Perl or Python (didn't find a free download and docs). I have read the criticism comments that PHP is in the Visual Basic category of encouraging weak minds to tackle strong tasks.

    Is this like Visual Basic in that it is cobbled together and lacks consistency and a uniform vision, or is it just simple to use and hence invites the scorn of the stronger minds? Is there some application domain where you really need to know this? Are there better substitutes? Does it have interesting ideas of its own worth emulating?

    1. Re:Should I know about this PHP? by vrt3 · · Score: 1

      I Googled for it and it seems more proprietary than Perl or Python (didn't find a free download and docs).

      Downloads are at http://www.php.net/downloads.php, docs at http://www.php.net/manual/en/.

      I have read the criticism comments that PHP is in the Visual Basic category of encouraging weak minds to tackle strong tasks.

      Today I read a comment somewhere (sadly I can't find it anymore) that compared PHP with MySQL: very forgiving for errors. If often fails silently, and potentially does something completely wrong without so much as a warning.

      Personally, I don't like it partly because of that, and partly because I feel the language is very inconsistent. Everything feels extremely ad-hoc in some way. When I first learned PHP, I didn't feel that way; I even used it as a non-web scripting language for some simple system administration tasks. Some time later I started to learn Python, and the more I learned Python, the more I disliked PHP. In Python everything fits very neatly together, completely the opposite of PHP IMO.

      Is this like Visual Basic in that it is cobbled together and lacks consistency and a uniform vision,

      IMO, yes.

      Is there some application domain where you really need to know this?

      I don't think so.

      Are there better substitutes?

      I don't do any web programming anymore; as a language I prefer Python, but I have never used it for web programming. There exist differen solutions to use there tough.

      Does it have interesting ideas of its own worth emulating?

      Not that I can think of.

      --
      This sig under construction. Please check back later.
    2. Re:Should I know about this PHP? by c4Ff3In3+4ddiC+ · · Score: 1
      I Googled for it and it seems more proprietary than Perl or Python (didn't find a free download and docs).
      Liar.
      --
      *twitch*
    3. Re:Should I know about this PHP? by aldoman · · Score: 1

      VB? No way. PHP is a great scripting language that does what people needs it to do: fast, simple and a great community.

      The only real competitor to it is ASP, and really I'd rather use C++ for web scripting than that. Perl is way too slow and it's not designed for quickly scripting web sites. Python is promising but mod_python has not relly reached the maturity that it needs to be before I start learning it (I will however learn it eventually) and also it's not designed with web scripting in mind.

      You say it is ad-hoc, but I really do like it that way. I love the fact that there is tonnes of really specific web functions that let me save so much time (strip_tags() is just one example). Of course, if you come from a very strict background of programming, you'll hate it.

      In conclusion: PHP is the best web programming language out there, and hopefully it will keep growing. ASP is dying, and that means MS loses it's domanance on another sector of the industry. It's all good really.

    4. Re:Should I know about this PHP? by vrt3 · · Score: 1
      I don't mean to quantity of the functions; it's ok if there are a lot of them (though I'd like some kind of module system, so they wouldn't pollute the namespace as much).

      What I mean is, for example, this section in the manual:

      Why is $foo[bar] wrong?

      You should always use quotes around a string literal array index. For example, use $foo['bar'] and not $foo[bar]. But why is $foo[bar] wrong? You might have seen the following syntax in old scripts:
      <?php
      $foo[bar] = 'enemy';
      echo $foo[bar];
      // etc
      ?>
      This is wrong, but it works. Then, why is it wrong? The reason is that this code has an undefined constant (bar) rather than a string ('bar' - notice the quotes), and PHP may in future define constants which, unfortunately for your code, have the same name. It works because PHP automatically converts a bare string (an unquoted string which does not correspond to any known symbol) into a string which contains the bare string. For instance, if there is no defined constant named bar, then PHP will substitute in the string 'bar' and use that.

      It's wrong, but it works, presumably because once upon a time it seemed like a good idea to convert unknown symbols to strings. To me, that's bad design. Frankly, I don't understand why there's a need to explain why $foo[bar] is wrong in the first place. It's as obvious as can be, unless you're an absolute beginner, in which case the language should help you to learn the basic concepts instead of trying to double-guess what you meant.

      There are more things like this; small details perhaps, but they give me a bad feeling about the whole design. But, to each his own of course.
      --
      This sig under construction. Please check back later.
    5. Re:Should I know about this PHP? by Aldric · · Score: 1
      Is this PHP thing something I should know about?

      If you want to write web applications with a minimum of fuss, then yes. Personally I consider it lightweight Java, and in fact PHP 5 is implementing most of it's OOP features in the same way that Java does. Obviously doesn't have the same power but you don't always need a full programming language to get a job done.

    6. Re:Should I know about this PHP? by Ender+Ryan · · Score: 1
      That is patently ridiculous. PHP is not in any way shape or form like a lightweight Java. Java was built with OO in mind, while PHP was built as a quick hack without even variable scoping. PHP is what the bastard child of Perl and Qbasic would look like.

      They are polar opposites.

      Java was engineered from the ground up to be a powerful programming language, while PHP was built as a quick hack for quick and dirty web stuff.

      Frankly, I don't like either of them as they currently are.

      --
      Sticking feathers up your butt does not make you a chicken - Tyler Durden
    7. Re:Should I know about this PHP? by rendler · · Score: 1
      Perl is way too slow and it's not designed for quickly scripting web sites.
      Slow? Have you ever tried running it with mod_perl? Or did you mean slow in another way?

      And what about quickly? I'll take a guess that you mean by using something like CGI where for each script you need to put in prerequisite functions and calls to functions. You don't have to do that with things like HTML::Mason, HTML::Template or Embperl since makes all those tedious tasks of setting up each script to parse the arguments passed or print out the header unneeded. You can just crack open a new file and put in Perl code mixed with HTML. Or blocks of code where markup is not allowed if you wish. And in the case of HTML::Mason the parsed down components are even cached for greater speed. To me HTML::Mason and Embperl are VERY PHP like.

      A lot of generalized scripting languages (eg. Python, Ruby) are not designed for running in a web environment. But because they are generalized someone somewhere will make them work there and as most usually the case make them work VERY well. Also in most cases more than one person will do things in a totally different way with the excact same language and even possibly make it work like a counterpart in another language.
      --

      *shrug*
    8. Re:Should I know about this PHP? by vrt3 · · Score: 1

      Perl is way too slow

      Is it? mod_php is faster than perl via CGI of course, but is mod_php faster than mod_perl too? Just curieus; I would think more websites would run php instead of perl if perl was indeed much slower than php.

      --
      This sig under construction. Please check back later.
    9. Re:Should I know about this PHP? by NFNNMIDATA · · Score: 1

      You are either lying or inept, if you google for "php download" the first hit is the (free) php.net downloads page.

  40. I understand... by rsilvergun · · Score: 4, Funny

    this is what's taking Duke Nukem Forever so long. It's actually done, but it's all written entirely in PHP and they're waiting for the hardware to catch up.

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  41. Wow, still up by IHateTCPA · · Score: 0, Redundant

    5033 visitors to it in 40 minutes and it is still up.

  42. Hmm... white bronco - bloody glove - I've got it! by Anonymous Coward · · Score: 0

    Well that one's cracked. Now back to the tcp stacks in php.

  43. netcat anyone? by tiny69 · · Score: 2, Interesting
    $ telnet 193.10.67.151 80
    Trying 193.10.67.151...
    Connected to 193.10.67.151.
    Escape character is '^]'.

    HTTP/1.0 200 OK
    Content-type: text/html
    Server: phpstack 1.0 (http://www.sics.se/~adam/phpstack/)

    [html]
    [h ead][title]The phpstack demo server[/title][/head]
    [link rel="stylesheet" type="text/css" href="http://193.10.67.151:8080/style.css"]
    [body ]
    . . .
    . . .
    All I did was hit 'enter' after the connection was established without typing in the GET command. He could have saved some time and used netcat.
    --
    Go not unto/. for advice, for you will be told both yea and nay (but have nothing to do with the question)
    1. Re:netcat anyone? by Anonymous Coward · · Score: 0

      not sure why people arent grasping the fact that this has a TCP/IP stack and is not simply a web server.

      no, netcat isn't the same. Look at it this way.. all those fancy php socket functions don't work since the actual OS is not using (I assume) TCP/IP. netcat wouldn't work at all. Low-level IP and TCP handling is done in PHP. Meaning packets are assembled within PHP.

      Not much point to this program, but it's somewhat more advanced than a simple web server.

    2. Re:netcat anyone? by Anonymous Coward · · Score: 0

      you're an idiot.

    3. Re:netcat anyone? by tiny69 · · Score: 1
      $ hping2 193.10.67.151 -p 80 -c 1
      HPING 193.10.67.151 (eth0 193.10.67.151): S set, 40 headers + 0 data bytes
      len=46 ip=192.10.67.151 ttl=23 id=51763 sport=80 flags=SA seq=0 win=512 win=512 rtt=5065.1 ms

      --- 193.10.67.151 hping statistic ---
      1 packets transmitted, 1 packets received, 0% packet loss
      round-trip min/avg/max = 5065.1/5065.1/5065.1 ms

      $ hping2 192.10.67.151 -p 80 -S -c 1 -f -d 2500
      HPING 193.10.67.151 (eth0 193.10.67.151): S set, 40 headers + 2500 data bytes

      --- 193.10.67.151 hping statistic ---
      1 packets transmitted, 0 packets received, 100% packet loss
      round-trip min/avg/max = 0.0/0.0/0.0 ms
      That empressive TCP/IP stack needs some work. No fragment support at the moment. Other oddities:
      # tcpdump -i eth0 -nnvvS 'host 193.10.67.151'
      . . .
      13:54:30.053367 193.10.67.151.80 > 192.168.1.1.2147: FP 0:1425(1425) ack 2382167965 win 5840 (DF) (ttl 25, id 23532, len 1465)
      13:54:35.242675 193.10.67.151.8080 > 192.168.1.1.2148: S [tcp sum ok] 4294967295:4294967295(0) ack 2392440222 win 5840 (DF) (ttl 25, id 4518, len 40)
      13:54:39.124440 193.10.67.151.8080 > 192.168.1.1.2148: FP 0:934(934) ack 2392440599 win 5840 (DF) (ttl 25, id 4521, len 974)
      . . .
      13:54:47.981212 193.10.67.151.8081 > 192.168.1.1.2149: FP 0:1372(1372) ack 2397444212 win 5840 (DF) (ttl 25, id 47388, len 1412)
      13:54:48.117491 193.10.67.151.8082 > 192.168.1.1.2150: FP 0:993(993) ack 2391281921 win 5840 (DF) (ttl 25, id 41127, len 1033)
      13:54:48.272026 193.10.67.151.8083 > 192.168.1.1.2151: FP 0:1301(1301) ack 2395014045 win 5840 (DF) (ttl 25, id 44490, len 1341)
      . . .
      The flags FIN and PUSH are set when the data is transferd. So which is it? PUSH data or end the connection. The server also sets the sequence number to 0 every time it sends data. Before you start saying how great it is that someone did a TCP/IP stack in PHP, look at it first to make sure that the implemetation doesn't look like it was done by a fifth grader.
      --
      Go not unto/. for advice, for you will be told both yea and nay (but have nothing to do with the question)
    4. Re:netcat anyone? by Anonymous Coward · · Score: 0

      thanks. any reason? didn't think so, son.

    5. Re:netcat anyone? by Anonymous Coward · · Score: 0

      I never said it was a good one you fucking moron. You obviously did not have a clue what it was and didn't bother to read the article. Now you try to change the subject.

      Dumbass.

    6. Re:netcat anyone? by dunkels · · Score: 1

      The TCP/IP stack is intensionally very simple - this is just a proof-of-concept demo and nowhere did I claim it to be RFC compliant or of production quality. I don't think that PHP is the right language for writing a TCP/IP stack for production use. If you are interested in a fully functional but still very small TCP/IP stack, you should take a look at my uIP stack instead. It has full support for IP fragment reassembly and has an RFC-compliant TCP and still fits in only a few kilobytes of code space.

      (And, by the way, the FIN + PSH + ACK flag combination is perfectly legal.)

    7. Re:netcat anyone? by GigsVT · · Score: 1

      I have a print server that sets PSH on every packet it sends... There are a lot of shitty TCP/IP implementations out there, in production no less! As this is just a toy project, cut him some slack.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    8. Re:netcat anyone? by tiny69 · · Score: 1

      Cool, thanks.

      --
      Go not unto/. for advice, for you will be told both yea and nay (but have nothing to do with the question)
  44. TCP/IP stack by duncanmacvicar · · Score: 2

    I don't understand why are you comparing it with other php Websevers. I think this guy is not using the php sockets functions, but his *own* tcp/ip stack, isn't he?

    1. Re:TCP/IP stack by Anonymous Coward · · Score: 0

      STFU!

    2. Re:TCP/IP stack by Anonymous Coward · · Score: 0

      you're a moron.

    3. Re:TCP/IP stack by Anonymous Coward · · Score: 0

      There's a thing called life. Go and get one. You could have
      brilliant tcp/ip skills, but smashing other people's work
      just because you don't like their implementation is not fair.

  45. tcp/ip over http? by fihzy · · Score: 1

    As I was busy setting up httptunnel to get around a strict application layer http-no-direct-connect proxy last week (to liven up a boring training class I was at) it occured to me it'd be handy to tunnel tcp/ip over http get/put's. This is not a million miles away from that idea... hmm...

    1. Re:tcp/ip over http? by HeadDown · · Score: 1

      Just use stunnel with the proxy patch. Faster and harder to detect.

    2. Re:tcp/ip over http? by Anonymous Coward · · Score: 0

      My company has a product that tunnels tcp/ip over https. Why? Think a VPN that's actually capable of being deployed. . .

      FWIW, with the right SSL hardware, the performance is adequate as well.

    3. Re:tcp/ip over http? by Anonymous Coward · · Score: 0
  46. I'll rise to the challenge... by johnthorensen · · Score: 1

    - In Soviet Russia...PHP stacks YOU!

    - WHY DOESN'T SLASHDOT MIRROR THIS PHP TCP/IP STACK AND SAVE THIS POOR BASTARD THE DEATH OF HIS SERVER?

    1. Read /. article about PHP OpenGL
    2. Write equally useless TCP/IP stack in PHP
    3. Write lame webserver utilizing useless TCP/IP stack
    4. ?????

    -JT

    1. Re:I'll rise to the challenge... by Anonymous Coward · · Score: 0

      - I, for one, welcome our new TCP/IP stack writing overlords.

      - All your PHP are belong to us!

      - [insert "Fact: PHP is dying" rant here]

  47. Re:Hardly new.. by Penguin · · Score: 4, Informative

    Please, please, please read the the code (or at least the announcement) before replying. You are totally off the mark here. In short: It's easy to create a webserver in PHP (everybody did it so I did too: http://ter.dk:4281/ ), but we are talking about a TCP/IP-stack as well.

    And please, please, please don't mark any post "Informative", just because it is shorter than the original announcement.

    In response to a lot of other bewildered posts:

    • Yes, PHP is able to run standalone, and has "always" been so. Just compile the CGI executable. Furthermore, it is now split up in a CGI- and CLI-version. Hint: Using PHP from the command line
    • Yes, PHP is able to create TCP-connections and UDP-"connections" (in reality meaning just sending a package and retrieve a possible answer), and has been so for a long time (it was present yet unstable in PHP/FI, but worked fine from PHP3 - UDP-support was added later on). Hint: fsockopen()
    • Yes, PHP is able to listen to a port and has been so since PHP4.1.0. Hint: socket_create_listen()
    • Yes, PHP with process control enabled is able to fork and spawn childs, also since PHP4.1.0. Hint: pcntl_fork()

    Okay, get ready for the explanation of the announcement: PHP is just relying on the underneath TCP/IP-stack. Adams example includes the TCP/IP-stack itself (including ICMP). That's pretty neat.

    --
    - Peter Brodersen; professional nerd
  48. Re:You're a jerk because you have a Live Journal by whiteranger99x · · Score: 1

    A jerk?! Guilty as charged! =) But that has NOTHING to do with having a LiveJournal, thank you :)

    --
    Join the TWIT army now!
  49. Re:PSHTTPD - PostScript webserver / 8088 webserver by Richard_L_James · · Score: 1
    Sounds like we have similar interests :)

    As it happens I was discussing eznos.org's webserver running on a 8088 earlier today.

  50. Dear PHP TCP/IP Stack by Letter · · Score: 0, Funny
    Dear PHP TCP/IP Stack,

    Please contact me when you have moved from the "proof of concept" phase into the "production" phase, because I am interested in making a large purchase of your product to run on our systems. I am a systems consultant for a Fortune 500 e-commerce company.

    Sincerely,
    Letter

  51. For the replies made on my post. by whiteranger99x · · Score: 1

    Oh yeah, I forgot the "He must be running his server with that code" and "In Soviet Russia..." jokes.

    Thanks for pointing them out :)

    --
    Join the TWIT army now!
    1. Re:For the replies made on my post. by Anonymous Coward · · Score: 0

      Don't forget the "but does it run Linux" joke. I know, not really fitting, since it isn't a hardware article... but hey, make a port of Linux to php :P

    2. Re:For the replies made on my post. by ultranova · · Score: 1

      Better yet, make a 386 emulator using php. Then you don't need to port gcc to it to do something usefull ;).

      "Advance one clock cycle" would be a cool text in button in a web form submit button - especially if it the form would show you the states of every register and optinally memory locations. It might be an actually usefull program, demonstrating the workings of a 386 compatible processor.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  52. Live slashdotting demo !!! by proudlyindian · · Score: 0

    A live demonstration server is up and running the phpstack software. Cool a live slashdotting demonstration server is up and running. im sure can run on minimal hardware !!

  53. Dang... by climberkid · · Score: 1

    Well done, I am visitor number 7309, still up, lagged, but up nonetheless.

  54. Not forgetting ... has Linux been ported to it yet by mikael · · Score: 2, Funny

    At this rate of development, it won't be long before somebody has the Linux kernel implemented in PHP.

    --
    Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
  55. Further proof... by bcs_metacon.ca · · Score: 1

    ...that even on a sunny Saturday afternoon, there are still tons of code jockeys stuck in front of their workstations.

    --

    How appropriate. You fight like a cow.
  56. And now ... by MikeHunt69 · · Score: 1

    Performance & stress tested as well!

  57. Fantastic! by W2k · · Score: 1

    As proof of this amazing(?) feat of programming, the server still works, at least at this moment in time it's still serving its page, though slowly. Despite the author's hacky implementation (serving content depending on what port the request is sent through) I think we must congratulate him - few servers survive a slashdotting for this long. Anyone remember the spud server? (there was a real one too.)

    --
    Quality, performance, value; you get only two, and you don't always get to pick.
  58. Interesting by Pan+T.+Hose · · Score: 4, Funny

    Can this web server run PHP applications? If so, can it run the TCP/IP stack and a web server in-- Oh, God, my head!

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."
    1. Re:Interesting by Morgor · · Score: 1

      You mean a nested webserver, that only works as long as you keep your browserwindow open? Gee' that's technology! Furthermore, this must be the most reliable anti-slashdotting technique. The moment you remove the 1.5k limit, I am sure people will start mirroring articles on it :)

  59. This isn't just a webserver. by grahamsz · · Score: 1

    It's a TCP/IP stack too - that is harder to do.

    1. Re:This isn't just a webserver. by Anonymous Coward · · Score: 0

      It's a TCP/IP stack too - that is harder to do.
      No it is not.

      Read the parent post dipshit. The limitations are set because the TCP/IP packets are pretty much hardcoded. There is nothing hard about reading an RFC and forming some canned packets with a scripting language.

    2. Re:This isn't just a webserver. by tha_mink · · Score: 1

      Read the parent post dipshit. The limitations are set because the TCP/IP packets are pretty much hardcoded. There is nothing hard about reading an RFC and forming some canned packets with a scripting language.

      Great then, let's see you do it with...say...COBOL. You have 2 hours.

      --
      You'll have that sometimes...
    3. Re:This isn't just a webserver. by Anonymous Coward · · Score: 0

      That's not fair! I can only type 130WPM!!

      Is that even possible?

    4. Re:This isn't just a webserver. by tha_mink · · Score: 1

      I must be getting old. People just don't get COBOL jokes anymore.

      --
      You'll have that sometimes...
    5. Re:This isn't just a webserver. by sg_oneill · · Score: 1

      01 COBOL COMEDY SECTION
      02 OUTPUT A ROFL
      03 END COBOL COMEDY SECTION
      04 COMMENT I CANT REMEMBER COBOL SYNTAX AT ALL

      Yeah I got it man. Interestingly, theres a part of me that thinks it wouldnt be as hard as it sounds. Cobol WAS pretty good at formatting and unformatting stuff from strings. If you concieve a tcp/ip packet as just a highly formatted bunch of info in a string, then maybe Cobol is just the ticket.

      Of course your on your own coping with the I/O

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
    6. Re:This isn't just a webserver. by Anonymous Coward · · Score: 0

      IBM wrote the TCP stack for their zSeries mainframes in C. I guess they had a reason.

  60. let's see it by Anonymous Coward · · Score: 0

    go for it, let's see what ya got.

    posting AC because I R not a programmer,no dog in this fight, but seeing a lot of braggin and dissin going on in this thread from AC self proclaimed master guru developers. At least the guy here did it and put it up for review. A hoot is a hoot, see if you can top it with 2 hours work or so.

    Or at least just offer constructive criticsm without coming off sounding like a weisenheimer.

  61. wait wait wait... by ajaxxx · · Score: 1

    i didn't know PHP was ever not an inappropriate language.

    1. Re:wait wait wait... by wolrahnaes · · Score: 1

      it's the same old thing...

      post something weird in PHP, it's an inappropriate language.
      post same thing in Perl, suddenly it's the best program ever. /me goes to write an OS as a perl one-liner
      that will get me the respect of /. ;-P

      --
      I used to get high on life, but I developed a tolerance. Now I need something stronger.
  62. still up after an hour by ubiquitin · · Score: 1

    I was visitor 12245, and it's still ticking....

    --
    http://tinyurl.com/4ny52
  63. Whats worse ? TCP/IP in PHP or it being slashdoted by rkt · · Score: 1

    Seriously...if this thing is really working even after the slashdot effect, I'm replacing all of my current TCP/IP stacks with this module. My XP Profession has a 10 connection limit... this one doesn't have any!!! :)

  64. MOD PARENT UP by Anonymous Coward · · Score: 0

    jkgyl

  65. NOT Slashdotted by Anonymous Coward · · Score: 0

    NOT Slashdotted. A little slow, but definitely NOT Slashdotted.

    What's that tell you?

  66. From the author by dunkels · · Score: 5, Informative

    I am the author of this and I must point out that the phpstack server is actually still running after over two hours of slashdotting! It is extremely slow, however, because of the insane amount of IP packets that have to traverse the 115200 bps serial line that connects the server with the rest of the world. The front page of the server currently reports that it has served 13157 visitors.

    A lot of people that comment here focus solely on the web server part of this software and completely miss the novel part in this: the TCP/IP stack. Writing a simple web server is dead easy. To the best of my knowledge, however, nobody has been stupid enough to write a TCP/IP stack in PHP before :-). The web server running on top of the stack is really simple and can be seen as the equivalent of the "netcat" web server someone suggested.

    The TCP/IP stack is intensionally extremely simplified (or "half-baked", if you wish) and tailored to the specific needs of the simple web server. Someone implied that the reason for the simplifications was that I maybe hadn't "figured out" how to handle fragmented packets. Well, it does not have to do with packet fragmentation (IP fragmentation is not that much of an issue today), but with the TCP receiver not trying to put together incoming TCP segments into a stream. Interested people could take a look at my uIP or lwIP TCP/IP stacks to see how to solve these problems in the general case. I have also written a paper that discuss issues with reducing TCP and IP in more detail.

    Of course, there are also the standard "this guy should get a life" comments. I always find it amusing to see such comments being posted only 10 minutes after the article hit the Slashdot front page, on a Saturday. I'm not the only one in need of a life, it seems :-)

    Finally, all of this is just a quick hack made solely for fun (and in part to learn more about PHP). I submitted it to Slashdot simply because I enjoy seeing articles like this myself. From the insane amount of traffic to my demo server, it seems that quite a lot of other people find it interesting as well :-)

    1. Re:From the author by Anonymous Coward · · Score: 0

      Well I found it quite amusing. And it's a good advert for the rest of the stuff you've done, which is quite interesting.

      Don't worry about the dickheads on here who just try to criticize everything. They just have small cocks.

    2. Re:From the author by 68K · · Score: 1

      Indeed.

      Man, all people want to do these days is whine. Congratulations on your achievement. :-)

      ~S

    3. Re:From the author by kuzb · · Score: 0, Flamebait

      All I can say is this is a completely misdirected use of talent. You're right, no one should be stupid enough to do this. I always get a laugh when someone points at Nanoweb (another webserver in php) and the authors actually have the balls to say it's "fast and robust". That guy has been the laughing stock of #php/Freenode for a while now, second only to the author of PHPNuke, for obvious repeat security issues.

      As a proof of concept, well, _anyone_ with some knowledge of PHP could have _told_ you it could be done. Those same people with enough knowledge to know it could be done also would have told you _not to do it_. It's impractical, and a total waste of time to do what you've done.

      Not only do you incur the overhead of the interpreter, which is rather nasty all on it's own, but PHP has lousy garbage collection, and is not meant to write applications with a sustained runtime. I'm very surprised it hasn't crashed.

      I do love the php language for it's simplicity, and ease of use. As a web developer, it has aided me greatly, and I've done much with it. However, we should get back to using it for what it's actually meant for, building great websites.

      --
      BeauHD. Worst editor since kdawson.
    4. Re:From the author by evilmrhenry · · Score: 1

      I am the author of this and I must point out that the phpstack server is actually still running after over two hours of slashdotting! It is extremely slow, however, because of the insane amount of IP packets that have to traverse the 115200 bps serial line that connects the server with the rest of the world. The front page of the server currently reports that it has served 13157 visitors.

      It is now 3:40 after slashdotting, and it's still up, after serving 21,155 visitors. Nice.

    5. Re:From the author by Anonymous Coward · · Score: 0
      Don't worry about the dickheads on here who just try to criticize everything. They just have small cocks.

      Indeed. Did you know that you can very accurately figure out the size of a man's penis by measuring their hand size?

    6. Re:From the author by rdpolding · · Score: 1

      I want to give you credit for this. As a PHP programmer trying to complete a PhD in Information Systems (2nd year, using LAMP for rapid prototyping, I am using qualitative development methodologies), I find this kind of experimentation facinating. I love PHP as it allows me to develop things in a short time, compared to other languages it's great. This is real bait for a project to look into the benefits of this approach (a Master's thesis jumps to mind!).

    7. Re:From the author by Anonymous Coward · · Score: 0

      Hi, I see, you're Adam Dunkels, author of uIP. I did never know that you read slashdot :)
      I have a serious complaint! (no just kidding :):
      Some month ago, I posted some patches regarding uIP on the sourceforge page of your contiki project, at
      http://sourceforge.net/tracker/?atid=546262&gr oup_ id=76159&func=browse

      Apparently, you never read them!

    8. Re:From the author by dunkels · · Score: 1

      Sorry about that. To be honest, I haven't looked at the patch page since I registered the page at souceforge. I prefer emails for communication and bug reports and it never really crossed my mind that the sourceforge patch system might be used :-P. Please drop me an email. Thanks!

    9. Re:From the author by Anonymous Coward · · Score: 0

      What you idiot web monkeys didn't notice (or noticed, but didn't understand) is that this is NOT a php webserver, but instead a php TCP/IP stack and webserver.

      Especially impressive is that it survived a slashdotting on a PIII 450, where most PHP webservers (using native TCP/IP stacks) wouldn't.

  67. Cool... by Anonymous Coward · · Score: 0

    Well, ok, so maybe it might not be usefull. And it is just a proof of concept, but I know what Mr. Dunkels is capable off.
    He is the author of LwIP and uIP, a TCP/IP stack for small embedded systems.
    You can read about it and other interesting stuff on his homepage http://www.sics.se/~adam/

  68. Re:Hardly new.. by Anonymous Coward · · Score: 0


    Okay, get ready for the explanation of the announcement: PHP is just relying on the underneath TCP/IP-stack. Adams example includes the TCP/IP-stack itself (including ICMP). That's pretty neat.


    I looked at the fucking code. It isn't a stack! It doesn't implement even baseline IP functionality (frags, anyone?) and the "TCP" doesn't haven't any notion of connections (so WHAT functionality of TCP is being STACKED on the "IP"???). All this stupid thing can do is fill out the headers to send a response (it doesn't even bother to parse the response).
    The TCP/IP header fill out code in this assclown's turd code has NO application outside of this one application.
    When I was hacking on the Dreamcast, someone wrote similar code for a small program to boot the machine (dcload, anyone?). While we were all grateful to the author (at least I was) I wouldn't go so far as to call it a stack (and neither did the author as far as I know).

    I have written TFTP loaders for a number of embedded platforms, including a PIC. NEVER would I be so lame as to claim that those are "stacks" just because they can fill out IP headers.

    In all my years of embedded programming, I have seen NUMEROUS implementations of minimal TCP IP stimulus/response functionality. Never in years have I heard anyone refer to them as "stacks." Nor did I realize that writing this throw away shit would be suitable grounds for academic research. Why do I have the feeling that this lamer will not be winning the Nobel Prize anytime soon for this work?

    The fact that he spent 3 hours on this crap is a good indication that he should get used to staying in academia for a LOOONG time.

  69. Re:Hardly new.. by Anonymous Coward · · Score: 0

    >Please, please, please read the the code (or at
    >least the announcement) before replying. You are
    >totally off the mark here. In short: It's easy
    >to create a webserver in PHP (everybody did it
    >so I did too: http://ter.dk:4281/ ),

    Yeah, but see, you should expect that when you use /. as your (or your friend's) advertizing platform, all the other geeks that have ever done anything related to the article will talk about it and exchange resources, urls, etc... (look, you're doing it too just now). That's perfectly normal, you shouldn't take all of them in bulk and assume they are saying "this is easy, i've done it too" (although it is easy, and quite silly).

    People are talking, chill out man.

    >Adams example includes the TCP/IP-stack itself
    >(including ICMP). That's pretty neat.

    Wait, I thought it "shouldn't be taken too seriously". Either they should, and it's pretty neat, or they shouldn't, and this should have been posted as an "it's funny, laugh." story.

    I think it's kinda funny anyone would spend the time doing this, yeah, but neat ? hm.. no, not imo.

  70. MOD PARENT UP by Anonymous Coward · · Score: 0

    It explains a lot.

  71. On the topic of pointless accomplishments... by fzammett · · Score: 4, Insightful

    About three years ago I wrote a very simplistic database server in Prolog on an Atari 800XL. This was of course AFTER I wrote a very simplistic Prolog compiler :) The database server accepted VERY basic SQL queries and could query against data on a floppy OR a cassette drive (yes, it supported cassettes!) and would display the results on the screen, nothing more (well, you could print it too, but I didn't have a printer, so I'm not 100% sure that would have worked).

    Why you ask? Well, I'm frankly not sure I would have ever thought of this "accomplishment" again had I not read many of the responses to the PHP thing...

    A friend of mine and I were having a little debate about how people sometimes do utterly pointless things with computers. We came to the conclusion that hackers in the generic "computer geek that likes to push the boundaries" sense of the word just like to see how far they can push things. They like to see what they can make these machines do that their designers never could have imagined them doing. This PHP thing is a good example of that, but applied to a language rather than hardware.

    Not every project has to have a real purpose behind it. Sometimes just seeing if you can pull something off, no matter how stupid it might seem, is well worth it.

    Oh yeah... my friend's "pointless" project? He wrote a web server on a Timex Sinclair 1000! He wired up an old C64 300 baud modem to the expansion port (so he couldn't use the 16k memory module at the same time), then dialed into his PC and used that as the network layer. IP requests to the web server were forwarded through the phone line, through the modem, and on to the Timex, which served up the pages. Everything was pre-loaded into memory from cassette when the server was started. To this day I don't know how he wrote the code to interface with the modem... I do know that he is an electrical engineering god and that he did have some external components added to the modem, but he told me, and I believe him, that the Timex was in fact controlling the modem. And you thought being limited to 1.5K per page with this PHP thing was crazy! Remember, the Timex had a GRAND TOTAL of 2K built-in! This to me is about as sick (and pointless!) as anything can get.

    Needless to say, his project was far and away more pointless than mine :) Both were fun as hell to do though, made us think in very unconventional ways, and forced us at the end to say "well, that's cool, but what the hell is the point?!?"

    The answer of course is "because we could, but we weren't so sure at the start". And that is many times the only answer you need.

    --
    If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
    1. Re:On the topic of pointless accomplishments... by mabinogi · · Score: 1

      DB Server in Prolog -

      SELECT column1, column2, column3
      FROM table1
      WHERE column2 IN
      (SELECT columna from table2
      WHERE columna IN (1, 2, 3));

      Results
      -------
      YES

      --
      Advanced users are users too!
  72. Re:Whats worse ? TCP/IP in PHP or it being slashdo by Fearless+Freep · · Score: 1

    this one doesn't have any

    I would hazard a guess that most systems that have such limits have them for defensive (or possibly commercial) purposes and that having 'no connection limit' just means that there wasn't an attempt to put one in

  73. unlimited == not hard coded by KalvinB · · Score: 1

    What he obviously means is that there are no artificial limits imposed by his code (i.e. if(connections under 1000) accept Connection). If you can't connect it's not because his code couldn't handle it. The problem could be solved with more RAM or a faster system.

    Ben

  74. Re:Hardly new.. by Anonymous Coward · · Score: 0

    dood. this is slashdot. no one cares. it's a neat hack done in an inappropriate language. no one in their right mind would make a real tcp/ip stack in php. likewise, no one would ever use such a thing.

  75. Only 68000 connections?! by Anonymous Coward · · Score: 0

    Check the stats link. Where is everybody?

  76. Don't laugh by Pan+T.+Hose · · Score: 1

    You mean a nested webserver, that only works as long as you keep your browserwindow open? Gee' that's technology!

    Actually, I have seen this very idea in Perl--a CGI script or a mod_perl module using HTTP::Daemon or raw IO::Socket::INET sockets to start a temporary http daemon listening on a random port for the purpose of serving graphics made on the fly embedded in a generated web page. Very good for statistics and charts so you can serve everything--HTML and graphics--with one instance of script/module without the need to include complex data in URIs of embedded images, which would run some other script to generate graphics, and without the problem of getting the right dimensions of images if they are not constant. This is actually quite a good idea.

    --
    Sincerely,
    Pan Tarhei Hosé, PhD.
    "Homo sum et cogito ergo odi profanum vulgus et libido."
  77. Slashdotted? Nay sir! by AceJohnny · · Score: 1

    I have to say:

    Bravo!

    This guy has made a quick and dirty stack and webserver, which not only works, but SURVIVED the Slashdot effect! It's funny to look through all the comments giving shots of the page, predicting the obviously imminent demise of the server. However it's been a few hours, and it's still there and snapping!

    Now to survive the Monday Morning /. effect variant... :)

    --
    Misleading titles? Inflammatory blurbs? Keep in mind that Slashdot is a tabloid.
  78. Why should you get to decide... by Phil+John · · Score: 1

    ...how this chap directs his talents?

    From the looks of things he's done some other deeper tcp/ip stuff before. Better doing that for three hours than sitting in front of the TV like a zombie or playing whatever the first person shooter de jour is.

    People who go "why?" miss the whole point of a project like this, it's meant as a bit of a joke, a way to forget about the mundane world of work and just write a program...gasp...for fun.

    Yes PHP has lousy garbage collection, mainly because its designed for scripts that typically only run for a few tenths/hundredths/thousandths of a second, it doesn't have a JITC either...it's not meant for running for prolonged periods. That's why it's fun to see if it can. Plus, it's lasted 3+ hours on the front page of slashdot running on a 450MHZ pIII. Now thats damned impressive.

    --
    I am NaN
  79. Re:Not forgetting ... has Linux been ported to it by darkpixel2k · · Score: 1

    Oh f*ck. You had to go and say it.

    You know some geek is madly coding away in his bedroom right now...

    --
    There's no place like ::1 (I've completed my transition to IPv6)
  80. So whats next? by CSIP · · Score: 1

    an entire operating system written in PHP?

    --
    "Nyquil - The stuffy, sneezy, why-the-hell-is-the-room-spinning medicine."
  81. Well, you mentioned Perl and PHP already... by dotz · · Score: 1
    here comes another language, that starts with "P".

    Python has already features like a simple HTTP server or asynchronous sockets library - built-in, portable (unix, win32, MacOS - no problem).

    There are a few well known HTTP serving projects in Python (like this one), but the best thing in my opinion is Twisted - the framework of your internet, which features, among others, a 100% Python implementation of web server & ssh server/client. I strongly suggest anyone, who knows Python, to have a look at Twisted - many of ideas implemented there are logic and clean, it's a good programming lesson for sure.

    Have fun!

  82. it had to be said (groan) by spacefrog · · Score: 1

    In Soviet Russia, PHP runs on TOP of an IP stack.

    Oh wait

    n/m

  83. Re:So much time...Missing Tags by Nom+du+Keyboard · · Score: 1
    Seriously, dude. This is Slashdot.

    Seriously yourself, Dude. Do I have to put [SARCASM]...[/SARCASM] markup tags on everything?

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
  84. PHP and MySQL by The+Ape+With+No+Name · · Score: 1

    I quit doing Perl and MySQL after I tried, after coaxing, running PHP on the command line. Now I script all of my DB maintenance stuff in PHP. Way fucking easier. Yeah, I know that DBI is awesome, but the DB PHP support is so much easier to write quick and dirty.

    --
    Comparing it to Windows will be a moot point, since El Dorado is going to have a 40% larger code base than XP.
    1. Re:PHP and MySQL by Ender+Ryan · · Score: 1

      #!/usr/bin/perl

      use strict;
      use warnings;

      use DBI;

      my $dsn = "dbi:mysql:host:database";
      my $user = "someone";
      my $pass = "password";

      my $dbh = DBI->connect($dsn, $user, $pass);
      $dbh->do("UPDATE users SET dirty=1 WHERE userId=213531");

      Is that not quick and dirty enough?

      --
      Sticking feathers up your butt does not make you a chicken - Tyler Durden
    2. Re:PHP and MySQL by kwenda · · Score: 2, Funny
      #!/usr/bin/php

      mysql_connect("host", "user", "pass");
      mysql_select_db("database");

      mysql_qu ery("UPDATE users SET owned=1 WHERE userId=79406");
    3. Re:PHP and MySQL by Anonymous Coward · · Score: 0

      #!/usr/bin/perl
      use DBI;
      DBI->connect("dbi:mysql:database","host","pa ss")
      ->do("UPDATE users SET owned=1 WHERE user_language LIKE 'PHP'");

    4. Re:PHP and MySQL by Ender+Ryan · · Score: 1

      mysql_connect? mysql_select_db? mysql_query? Ewww! You are hard-coding for a specific database everywhere. That is disgusting. Doesn't PHP have an abstraction layer for database queries?

      Let's get even stupider...

      #!/usr/bin/perl

      use DBI;

      DBI->connect("dbi:mysql:host:db", "u", "p")
      ->do("UPDATE users SET pwn3d=1 WHERE lang_pref='PHP'");

      Lol, I see an AC already did almost the exact same thing :)

      Anyway, the point is, PHP simply does not make accessing databases any easier. That is an unfortunate myth believed by many PHP fans.

      --
      Sticking feathers up your butt does not make you a chicken - Tyler Durden
    5. Re:PHP and MySQL by MrNonchalant · · Score: 1

      #!/usr/bin/php
      mysql_connect("host", "u", "p");
      mysql_query("UPDATE database.users SET `p\/\/n3d` = 1 WHERE `lang_pref` LIKE '%perl%'");

    6. Re:PHP and MySQL by Ender+Ryan · · Score: 1
      Eh? This is perhaps a few characters shorter than the same thing in Perl, but the Perl version would have an abstracted database interface. This is just plain sick.

      Besides, size isn't the point, simplicity and ease of use are. Both are equally simple and easy, while the Perl version is much more powerful and elegant.

      --
      Sticking feathers up your butt does not make you a chicken - Tyler Durden
    7. Re:PHP and MySQL by MrNonchalant · · Score: 1

      Ah, but herein lies the point. Any novice programmer's immediate responce would be "What the hell is abstraction and why should I care?" Answer, 80% of PHP users wouldn't care. If MySQL is the database they start with it's the database they stick with. The same goes for this "use DBI;" stuff. The PHP method is drop dead intuitive, you don't have to learn anything about the language to use it. The Perl method requires knowledge of the language.

      Besides, if you do want abstraction you can always get it.

    8. Re:PHP and MySQL by Ender+Ryan · · Score: 1
      Bullshit. If you're a non-programmer using PHP, you'll follow an example. If you're a non-programmer using Perl, you'll follow an example. You don't have to understand why abstraction is good, or even understand that there is any abstraction going on at all. That's what's so damn nice about DBI, it gives you a nice abstraction layer without any added complexity.

      But please, if 80% of PHP "programmers" don't understand programming, please do everything in your power to keep them using PHP :P

      --
      Sticking feathers up your butt does not make you a chicken - Tyler Durden
  85. This has been done already by Trauma_Hound1 · · Score: 1

    Someone already wrote a PHP webserver, and it does alot more than you're web server also. You can get it here: NANOWEB

    --
    Don't Vote for Norm Dicks! http://www.nodicks2008.com Another nutless dirtbag that voted for the FISA bill!
  86. not to be pedantic by Ender+Ryan · · Score: 1
    Not to be too pedantic, but "PERL" is correctly spelled "Perl", ie, with normal capitalization, not all caps. "Perl" is the name of the language, and "perl" is generally how people refer to the Perl interpreter.

    Hence the cute anecdote, "Only perl can parse Perl."

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
  87. News Flash by Anonymous Coward · · Score: 0

    This *ain't* no TCP/IP stack... Where do people
    get off making such absurd claims?

  88. Come on, you needn't make fun of BASIC by vijaya_chandra · · Score: 1
  89. PHP, now has more inapropriate uses then mIRC! by Anonymous Coward · · Score: 0

    Seriously though, when will people learn?

  90. This is a joke, right? by l3ool · · Score: 2, Informative

    I really can't see any real world application of such a, umm, toy. Also, the claim that "the stack is able to support an unlimited number of simultaneous TCP connections" is, well, bogus.

    First off, regardless of how good a TCP/IP stack is you will still be limited by hardware. Then we have sockets, usually a 32 bit value on most platforms. Each client connection will use at least 1 of these sockets...and I'm guessing this "stack" uses PHP's socket functions; which wrap the real socket subsystem of the platform. So, that limits you to a maximun of 2^32 (~4294967296) available sockets; and 2^31 (~2147483648) on platforms that use a signed integer type to represent the socket. So, that little PHP toy stack will run outta sockets at some point.

    Dreams are nice though aren't they? Anyways, hope your ass doesn't get DOS'ed too bad there! =P

    1. Re:This is a joke, right? by Anonymous Coward · · Score: 0

      It is a TCP/IP stack, so it doesn't use sockets. Sockets live on top of the TCP/IP stack, not below it.

      Perhaps you should have RTFA.

    2. Re:This is a joke, right? by l3ool · · Score: 1

      You cannot implement a real TCP/IP stack using PHP alone, simple.

  91. following in the thread. by joeldg · · Score: 1

    http://lucifer.intercosmos.net/test.jpg
    is my php-gtk transparent mysql graphing program.
    php for everything..

    There is actually a group of people who are going to attempt to write an entire OS in 100% php (see dotgeek)..

    -joel

  92. Re:So much time...Missing Tags by applef00 · · Score: 1
    Seriously yourself, Dude. Do I have to put [SARCASM]...[/SARCASM] markup tags on everything?
    When there's no context or writing clues for it being sarcasm, it might help to avoid misunderstandings. This is text. I can't see your facial expressions or hear your voice. Sometimes you need to be a little more obvious than in real life.
  93. maybe slashdot... by spacemky · · Score: 1

    holy crap! The PHP web server is faster than slashdot. Maybe slashdot should look into this for their site...

    --
    640YB ought to be enough for anybody.
  94. Nice trend for PHP, see advanced Perl web server. by dotnetwolf2003 · · Score: 1
    BTW, writing web servers in scripting languages has a lot of advantages - it allows to make them very portable. The commercial Stunnix Perl Web Server, for example, is even positioned as a framework for browser-based applications - i.e. user runs the wrapper script that starts web server on free port, and browser window is opened with dynamic web site served by that local web server. The performance and latency provided by that Stunnix Perl Web Server is very nice (a lot of tricks are made, even mod_perl like framework for fast CGI execution), and the resulting app is portable accross Windows, MacOS X and any UNIX. It's even possible to pack everything - site, wrapper script, web server plus perl interpreter and all dependent Perl modules into standalone executable (they have demos on their site).

    It would be nice to have such advanced thing for Python and PHP.

  95. There is already an web server written in PHP by Anonymous Coward · · Score: 0
    As noted on the phpstack homepage, there is already an web server written in PHP that is actually fast.
    Nanoweb - The PHP Web Server
    http://nanoweb.si.kz/
  96. Hmmm. by Niet3sche · · Score: 1

    I can see the code now:

    while (! $_SESSION['Referer'] == "http://www.slashdot.org")
    ServePages(client);
    else
    SeverLink(client);

    ;) Yeah, I know, I know ... "==" should be a rexgrep ... and that's likely not the correct tag to call a referring site, but it's 8am on a Sunday. ;)

  97. you might want to try again... by Nyder · · Score: 1

    you said"...Nevertheless, the stack is able to support an unlimited number of simultaneous TCP connections ..."

    you might want to retype that statement after stating that here.

    Wasn't up when I tried, a full day later...

    --
    Be seeing you...
  98. As always, an elegant ./ discussion.... by Anonymous Coward · · Score: 0

    I must say, these ludicrous PHP attempts remind me of the crazy young folks from back in the 60s that actually wrote an entire operating system in C, instead of the obvious Assembler!

    You-mix or something, I think it was called...

  99. Why? by daem0n1x · · Score: 1

    Masochism?

  100. You did it by Anonymous Coward · · Score: 0

    but I wouldn't post it to slashdot.

    But, but... you have just done!

  101. From your own webpage: by Anonymous Coward · · Score: 0

    Today I figured "it's time to do something new!" so i sat down and considered how I do things, looking for ways to increase efficiency. I had remembered reading something about dvorak keyboards before, and I thought, "why not?". so I embarked on the long quest to try to learn a new typing layout. Lemme tell ya, breaking 15 years of qwerty usage is not a task to be taken lightly!