Since C++ is compiled, the code and functionality has to be perfect before you put it on the server. If you have to make a change to the script, you need to recompile as well.
With the other scripting languages, to make a change is very simple as the scripts are interpreted on the fly. It's easier also to compose the script line by line and test as you go without having to compile.
Another thing to think about, many servers do not like to run strange exe files.
Well IMO you are right, mostly. In the end it really depends on what you need to accomplish and the situation at hand. Consider this however, javascript runs client side so you really can't compare it to Perl, PHP, and C/C++. There are times when it is desireable to offload server cpu to the client and therefore javascript becomes a good choice, for example when parsing and validating form input.
Perl and PHP are a tradeoff compared to C/C++, a lot can be accomplished with much less code and complexity at the expense of speed (sometimes) and direct control of some low level machine functions.
The clincher though is that unless you are in control of the server you can't run C/C++ on most web hosting accounts, but Perl and PHP are offered as a standard. That makes code written in Perl and PHP usable on a great many more sites than the same code written in C/C++.
However, there is another type of efficiency/speed and that is development time. While C/C++ will do everything the other languages do, it's difficult at best. An example: If you want to make a page with a dynamically generated date somewhere that has the current day. C/C++ can generate the date and even format it easily enough if you know your stuff, but then you need to output the rest of the page to stdout. The most obvious thing is to output a couple of constant strings, but then you have to handle escaping various slashes, quotes, endlines, etc. Then you still have to compile on the server. In php, you just load up your favorite html editor, design the page, throw in a 1 line php tag for generating the date that shows up as a comment to the editor and thus wont break anything. Upload and you are done. When you want to change the design, you can do it in your favorite WYSIWYG.
Then there is the other extreme: If you are doing hardcore calculations on the other end before generating minimalist html(such as database analysis of logs or something), C/C++ is the better choice.
As I've always said, pick the best tool for the job. The more tools you have available to you, the better off you will be (although the law of diminishing returns always applies).
The need to compile is trivial. It takes a few seconds on your own Linux box. You compile it for static libraries so that the sysadmin can't screw up the Linux system by upgrading or moving libraries or whatever. Just upload the compiled program into the cgi-bin directory. The compiled program may look bulky when static linking is used (between 100 and 200K using gcc, even after you strip out the symbols), but it's faster than hell.
I can handle and log in my own custom log, about 20 executions per second, sequentially from the same source, with a compiled C program on a plain 500 MHz Linux box with a T1, and keep the load under 1.0. I don't think an interpreted script would do this well.
One has to be wary about saying that C++ will do things 2 to 5 times faster than a scripting language. Not that the statement is untrue but elapsed time for an application is more than code.
Say your application is data entry, The speed of the typist has more to do with the time of completing the job than the C++ code.
If your Internet connection is 9.6 the improvement gained by the C++ code is lost. If you read a data file, retrieval time generally more important that the speed of the processing code.
Low level languages just don't give the same bang for the buck as higher level ones. C++ is a higher level language than assembly but the scripting languages are higher level still (and probably implemented using C++.)