logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_fcgid doesn't want to work (500) Page Previous  1, 2
Author
tomw



Joined: 10 Sep 2007
Posts: 4

PostPosted: Fri 14 Sep '07 15:40    Post subject: Reply with quote

I am using Apache 2.2.4.

Embedded manifests are turned on for the library and application (libfcgi and echo.exe).

There are a few different compiler switches between the NMAKE and IDE versions that I plan to investigate.

Preliminary examination with depends.exe showns no difference in dependencies. The IDE version of echo is about half the size of the NMAKE version, both are compiled as release.
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Fri 14 Sep '07 23:58    Post subject: Reply with quote

re: "The IDE version of echo is about half the size of the NMAKE version"

That may be a good clue! The smaller IDE version may have linked with libfcgi.lib, which tells it to look for libfcgi.dll at runtime.

If the NMAKE version links directly with the fcgi*.obj files - that would put all the necessary fcgi* code directly into echo.exe, so no runtime .dll is needed.

If you do need libfcgi.dll - echo.exe will only find libfcgi.dll if it is:
    1. in the same directory as echo.exe
    2. in the System PATH
    3. in the PATH you give to mod_fcgid with the DefaultInitEnv PATH ... directive
My preference is #3.

Don't make the mistake of thinking that because libfcgi.dll is in your PATH when you start Apache that echo.exe will find it.
echo.exe runs in a separate process, and will only look in 1, 2, or 3 above for any .dll's that it needs.

If this isn't the answer - another reason for the size difference could be:
    * statically linked executables (compiler switch /MT for Release builds, or /MTd for Debug builds) put the C runtime library code directly into the executable.

    * dynamically linked executables (compiler switch /MD for Release builds, or /MDd for Debug builds) expect the MSVC*80.dll runtime library files to be properly installed on your system, and need a manifest to select the correct one to use.
When you installed VC8 this should have also installed the proper MSVC*80.dll runtime library files. If you need to run echo.exe on another computer, you can download the Release version of the runtime libraries (MSVC*80.dll) from Microsoft at this link. They typically get installed into the %SystemRoot%\WinSXS\ directory.

The flaw in both these ideas is that depends.exe should have shown different dependencies. Maybe the size difference is that one has debugging symbols in it and the other doesn't.

-tom-
Back to top
tomw



Joined: 10 Sep 2007
Posts: 4

PostPosted: Mon 17 Sep '07 18:13    Post subject: Reply with quote

The difference in th sizes of echo.exe is due to the use of incremental linking in the nmake version. If I set VC8 for incremental linking, I get a longer echo.exe, but it still does not run.

I always put the required .dll files (from the same build as the .exe files) in the same directory as the executables.

Just for fun I also built the fastcgi apps with VC7 and everything works.

There is clearly something wrong in VC8. For now, I will have to use VC7.

Thanks for all of your efforts. I'm going to see if the fastcgi forum has any suggestions. I'll report back if I find a resolution.
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Tue 18 Sep '07 16:30    Post subject: Reply with quote

re: "There is clearly something wrong in VC8"

I don't think it is VC8 in general.
I can build example\echo.c with Visual Studio 2005 C++ Express Edition using the IDE and it runs fine for me with mod_fcgid on Apache 2.2.4.

The size of my echo.fcgi (Release build) is 6,656 bytes.

FYI - I used these Properties:
Code:
C/C++ - Additional Include Directories:     ..\..\include
C/C++ - Preprocessor Definitions:           WIN32  _CONSOLE  _MBCS
Linker - Additional Library Directories:     "..\..\libfcgi\$(ConfigurationName)"
Linker - Additional Dependencies:           libfcgi.lib
Linker - Output File:                       $(OutDir)\$(ProjectName).fcgi


-tom-
Back to top


Reply to topic   Topic: mod_fcgid doesn't want to work (500) View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules Page Previous  1, 2