Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7415459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:18:26+00:00 2026-05-29T07:18:26+00:00

Per this post here there are 3 ways (1)do the whole thing in C++,

  • 0

Per this post here there are 3 ways

  • (1)do the whole thing in C++, making your program a standalone web server (possibly proxying through apache to provide things like ssl, static media, authentication etc.)
  • (2)run C++ in a cgi-bin, through apache
  • make a PHP wrapper that shells out to the C++ part (this is a nice option if the performance-critical part is small, as you can still use the comfort that PHP’s garbage collection and string manipulation gives you)

I’m not sure which is best so I looked at what a high volume site does. Here is a post from Facebook in 2010

They use a static analysis tool Hip Hop, to convert PHP to C++.

I don’t need the static analysis tool as I only have about 1500 lines and can convert by hand…but I need a starting point.

Right now I run a Lamp stack and want to stay on it minus the (P)HP.

Here is a link that explains how Facebook works. Not sure how accurate it is.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:18:28+00:00Added an answer on May 29, 2026 at 7:18 am

    As the comments note, Facebook is almost certainly using a highly-customized solution that involves high administration costs in return for very high efficiency. It is unlikely that this is actually what you want.

    Since what you want is simply to replace the “P” in your LAMP stack, that implies that you probably want to keep the “LAM” — the Linux, Apache, and MySQL (if relevant) parts. That’s a good idea; while there are advantages at Facebook’s scale to running a custom web server, it is extremely unlikely that it will actually be useful for you, and continuing to run Apache is certainly much easier and simpler. (And probably more secure, since you don’t have to think about the security and fix bugs all by yourself.)

    And you’re planning to translate all your PHP, not just part of it, so calling C++ from PHP doesn’t make sense.

    Thus, in your case, the best solution is most likely to be running the C++ application via cgi-bin with your existing Apache server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm dynamically adding a custom user control to the page as per this post
Referencing this post: ruby on rails average per day I'm getting the average per
This blog post demonstrates a way to implement a mutex per string id idiom.
So facebook just implemented this per-app post privacy setting for all applications as announced
Per this helpful article I have confirmed I have a connection pool leak in
Per this question (see comments near the bottom), I was wondering if anyone knows
As per this MSDN article: W3C Extended Log File Format (IIS 6.0) It says
I need to have a single instance application (as per this answer ), but
I'm trying to build a Synergy AutoStart script as per this article , the
I am putting a label on a UIToolbar (per this tip: Adding a UILabel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.