Live data from Hacker News

Facebook PHP Source Code from August 2007

gist.github.com

91–100 of 154 posts

Re: Facebook PHP Source Code from August 2007

#91
post #30
post #20

Earlier quoted context omitted.

I remember listening to an interview with Markus from Plenty of Fish, where he essentially said that he didn't worry too much about site errors because most unsophisticated users would attribute them to things like their ISP, browser (if they knew what that was), or their own error more often than to the site itself. Personally, I can't bring myself to not care like that, but it seems to have worked pretty well in th…

I must admit my comment was unneccessarily bitter, but my observation is completely different. Many friends and family members are now seeing data loss on Facebook weekly at least . I wouldn't call them tech savvy either, yet they can attribute the issue to Facebook, after having learnt the simplest basics of how the web should actually work.

That's probably by design. Would you prefer one unimportant message lost here and there, or be able to handle 1/1000 of the current traffic to make sure every single message is delivered?

Re: Facebook PHP Source Code from August 2007

#92
From linked article "It seems that the cause was apache and mod_php sending back un-interpreted source code as opposed to output, due to either a server misconfiguration or high load (this is a known issue)."

Does anyone know what he is referring to when he says this can happen via high load?

Re: Facebook PHP Source Code from August 2007

#93
post #64
post #57

Earlier quoted context omitted.

They would be applying some search logic in memory in PHP. Depending on what you are doing it does make sense to load in a heap of data from the database then narrow it down in PHP.

That sounds grossly ineffective. Reminds me of some production PHP I saw once, returned the entire database (`SELECT * from 'db'`) and manually walked through it with a for() loop. It wasn't very efficient at scale.

[deleted]

Re: Facebook PHP Source Code from August 2007

#94
post #53
post #48

Earlier quoted context omitted.

Are you a PHP programmer?

I don't know. I can program in PHP. Does that make me a PHP programmer?

LOL:-) I know the feeling.

Someone recently mocked a full-stack-developer on HN as "I can javascript and servers too..". Oh man, how it made me cringe...In another 10 years, may be I won't have to. Off to dreaming...and coding...where is google....and stackoverflow of course...

Re: Facebook PHP Source Code from August 2007

#95
post #89

Earlier quoted context omitted.

Ship too late and none of it will matter.

I guess shipping is more important to you than the possibility of losing user details (or worse). Christ, I hope I never give my details to a company you found. Shipping quickly is important but it's also important to write quality code. Small bugs that can easily be fixed are fine but security problems or bugs related to payments, for example, are not.

so, maybe, just maybe, you take a bit more time on parts involving security (that is to say, handling of user credientials (includes session management, cookies, etc) and payment related things)?

Re: Facebook PHP Source Code from August 2007

#97
post #44

Earlier quoted context omitted.

You make a fair point and I guess everything is relative. My post was not meant to trash the code, but rather to point out that this code shows us that the primary objective shouldn't necessarily be writing the perfect code.

> My post was not meant to trash the code, but rather to point out that this code shows us that the primary objective shouldn't necessarily be writing the perfect code. That's a dangerous argument. I mean, if startups stopped pursuing the most elegant code, they wouldn't need, nor would they be able to hire, the "best" developers. And then what? 1. Lots of startups would be able to get off the ground and grow with le…

I was halfway through my rebuttal of your comment before I realized it was satire. Well done. :)

Re: Facebook PHP Source Code from August 2007

#98
post #92

From linked article "It seems that the cause was apache and mod_php sending back un-interpreted source code as opposed to output, due to either a server misconfiguration or high load (this is a known issue)." Does anyone know what he is referring to when he says this can happen via high load?

It is a myth. High load has nothing to do with it. However if you configure apache wrongly, it will serve .php files as text. Only connection to load is if you have one broken server among N proper ones, a number of times that the broken one is hit depends on load - I.e. on low load, it may be configured so that it is never hit at all.

I guess the story about apache serving php source under high load came from the idea tha Facebook is a high load site (true) and they couldn't just have made as obvious screwup as misconfiguring a production server (false) so it must be apache/php bug that happens only in high load sites (false)

Re: Facebook PHP Source Code from August 2007

#99

How did someone "expose the PHP source code"? Did they actually find a way to make the code show up client-side, or was it just someone who managed to get access to the backend stuff? The way it's worded makes it sound like the former, but that seems unlikely...

They misconfiguring apache to serve php as text file instead of being processed by php engine. One missing line in apache config can do that. It didn't last long, but of course people saved every bit that was leaked this way. Which is mostly entry points of course.

Re: Facebook PHP Source Code from August 2007

#100
post #62
post #58

Earlier quoted context omitted.

It's probably still there and has probably never caused any problems. In other words I think iand is exaggerating.

It is certainly not still there given that facebook doesn't run PHP any more. They wrote a compiler to translate a subset of PHP to C++, which they then compiled into a massive executable. The compiler is open source and called hiphop, and it does not implement the PHP memory limits.

They don't do that anymore. Ask your Facebook friends, hphp has changed since then.
Post reply on HN