In the apache configuration to run Windows programs fcgi

        FastCGI program can use c ++ language to write, so that we dynamically generate a web site when you can be more flexible, in addition to calling c ++ library, you can also add API platform, had run up under linux fastCGI program, did not expect to migrate to still a lot of problems under Windows platform, when you scratch my head would not think the problem is very hit people.

       At the beginning, use the default configuration to install apache, the next step to complete the next step. Programs created with fastCGI libraries can not run under apache. View error.txt found, fcgi_mod can not spown progress ...., mod_fcgi not run C: \ Program. FastCGI program is a very good place to debug it is really very difficult, there is no way to break something, but error can only see error.txt. This project is very urgent problem in time to waste two days, finally found the problem is really ridiculous. Not apache can not run C Program (C program can not run), but can not run C: \ Program!

       Paths are to blame. apache default installation directory is C: \ Program Files \ Apache2.2 \. When the Apache module creates fastCGI process, the path will pass a fastcgi program, because "Program Files" middle of a space, the value of the latter have been cut off, so create a C: \ Pramgram process. Of course, he failed. Under the apache install directory directly to the C drive, the problem is solved.

      

        In the Windows platform written in c ++ fastCGI program requires fastcgi libraries can be found in www.fastcgi.com official website, download decompression, which has a Makefile.nt file, you can find the path in the VS Command Prompt, and then nmake Makefile. nt compilation, compiled successfully in the Release folder will find libfcgi.dll and libfcgi.dll.manifest files, plus the header files include folders, you can write a program fastCGI.

        Solve a major problem after the discovery, fastCGI fail, I thought, was estimated to be put under the program path libfcgi.dll, or on systems Windows \ system32 \ at this time, because the project was created with VS, by compiling, debugging and running a try, you can not find msvcr80d.dll, and then can not find msvcp80d.dll like. This problem is related to the manifest file, because the VS CRT library has many versions, dll needs to know which version you want to call, which requires the manifest file, but often manifest file is embedded in the dll or application, so sometimes You do not need it, but why I compiled fcgi-2.4.0 libraries, the compiled output, in addition to a libfcgi.dll, there is a libfcgi.dll.manifest file. The libfcgi.dll.manifest added to the manifest input program finally can run up! .


         When I was all done, the fastcgi website transplanted to another one machine, clean newly installed system. They found is annoying spawn process error, you can view with their own tools depends.exe VS of fastCGI program which dll dependency, see MSVCR80.DLL and MSVCP80.DLL full path and version number, the version found where the system than it low, and finally download the latest runtime, problem solved!

       In fact, in the event viewer windows Serve 2003 management tools can be found in the System Tray error can not find the corresponding version of the MSVCR80.DLL and MSVCP80.DLL. Can not find DLL will immediately prompt an error when the program starts in general. FastCGI happens only in the apache error.txt record makes you difficult to understand the creating process.

       Finally successful dynamically generated website.

Published 15 original articles · won praise 2 · views 50000 +

Guess you like

Origin blog.csdn.net/imhikaru/article/details/6870472