locked
FCGX_ odd behaviour in libfcgi.dll RRS feed

  • Question

  • User-1910087654 posted

    As has been explained to me in private email, there is no help available for the third party dll libfcgi.dll

    After working on this for seven 10hr days in a row I am left with the conclusion that FastCGI is primarily designed for PHP users and there is very little help available for those of us creating FastCGI binaries.

    This has been a long difficult process and unless you want to do a weeks worth of reading and hair pulling I suggest using PHP! 

     

    Wednesday, November 12, 2008 4:57 PM

All replies

  • User-1653247517 posted

    Hi Mike,

    FastCGI is not primarily designed for PHP. We are definitely interested in seeing ruby, phython, perl, other CGIs/FastCGIs running on IIS. Yes, we haven't looked at challenges involved in writing a fastcgi client process using libfcgi. I might look at it someday and will do a post but don't count on that happening anytime soon.

    Thanks,
    Kanwal

    Tuesday, November 25, 2008 8:55 PM
  • User-1910087654 posted

     Hello Kanwal,

    Thank you for your reply... finally! I can see this forum is like corespondence chess...

    >we haven't looked at challenges involved in writing a fastcgi client process using libfcgi

    Who is we? MS I assume?

    I seems that you have tremendous capability with FastCGI to provide a well designed interface for those of us that choose not to use .BLOAT or  Java/JavaScript to write client applications that can perform some serious server communication all the way up to a Comet Server.

    An application compiled in C, C++and even VB FreeBasic etc can easily include this functionality with FastCGi if you would get behind libfcgi.dll.

    Is it any wonder that everyone I talk to tells me I am nuts to attempt this and I should just use the well trodden paths with all their attendant issues.

    It does not seem hard to create a C API that would allow IIS to route incoming requests to the named executable ie

    www.MyServer.com/cgi-bin/fcgiapp1.exe

     www.MyServer.com/cgi-bin/fcgiapp2.exe

    www.MyServer.com/cgi-bin/fcgiapp3.exe

    Yet this is impossible. I have to resort to some complex routing schema with IIS and extension names or an ISAPI module of some kind.

    So it does appear that FastCGi is tailored to scripts like PHP.

    This is why those that don't reccomend Java or .BLOAT insist I use PHP.

    So what is wrong with PHP?

    To quote another thread:

     

    • PHP has inconsistent naming of built-in and library functions. Predictable naming patterns are important in any design.

    • The PHP developers constantly deprecate built-in functions and lower-level functionality. A good example is when they deprecated pass-by-reference for functions. This created a nightmare for anyone doing, say, function callbacks.

    • A lack of consideration in redesign. The above deprecation eliminated the ability to, in many cases, provide default keyword values for functions. They fixed this in PHP 5, but they deprecated the pass-by-reference in PHP 4!

    • Poor execution of name spaces (formerly no name spaces at all). Now that name spaces exist, what do we use as the dereference character? Backslash! The character used universally for escaping, even in PHP!

    • Overly-broad implicit type conversion leads to bugs. I have no problem with implicit conversions of, say, float to integer or back again. But PHP (last I checked) will happily attempt to magically convert an array to an integer.

    • Poor recursion performance. Recursion is a fundamentally important tool for writing in any language; it can make complex algorithms far simpler. Poor support is inexcusable.

    • Functions are case insensitive. I have no idea what they were thinking on this one. A programming language is a way to specify behavior to both a computer and a reader of the code without ambiguity. Case insensitivity introduces much ambiguity.

    • PHP encourages (practically requires) a coupling of processing with presentation. Yes, you can write PHP that doesn't do so, but it's actually easier to write code in the incorrect (from a sound design perspective) manner.

    • PHP performance is abysmal without caching. Does anyone sell a commercial caching product for PHP? Oh, look, the designers of PHP do.

    Worst of all, PHP convinces people that designing web applications is easy. And it does indeed make much of the effort involved much easier. But the fact is, designing a web application that is both secure and efficient is a very difficult task.

    By convincing so many to take up programming, PHP has taught an entire subgroup of programmers bad habits and bad design. It's given them access to capabilities that they lack the understanding to use safely. This has led to PHP's reputation as being insecure.

    (However, I will readily admit that PHP is no more or less secure than any other web programming language.)

    What is it that I'm missing about PHP? I'm seeing an organically-grown, poorly-managed mess of a language that's spawning poor programmers.

     

    I have a had a steep learning curve with FastCGI and there are some design skews that seem to indicate PHP was at the top of the list when developing it. So It would be nice to see some REAL support for this excellent FastCGI capability with a C API.

    Since I am discussing the use of languages, I should probably include a (humerous) description of why I do not use some of them. From ted dennison:


    Ada : You aim at your foot and pull the trigger, but the safety stops the gun from firing. The safety won't budge until you tag your foot with a sign reading "Bullet Hole in this foot", and call the paramedics. You do so, then shoot yourself in the foot.

    C : The gun comes in 38 pieces, with a set of assembly instructions. After painstakingly assembling the pieces, you pull the trigger and the gun promptly backfires and blows your head off.

    Assembly : The same as C, except you have to hand-machine all the pieces as well. When you pull the trigger, your whole house explodes.

    Java: You break into someone else's home and steal their water pistol. You then make a child gun that uses .38 rounds instead of water. When you pull the trigger on the child gun, nothing happens to you, but everyone who visits your house gets shot in the foot.

    Basic : You aim the gun at a straight horizontal and pull the trigger, which causes a stream of water to be squirted straight down onto your foot.

    Perl (PHP): You aim the gun at your foot and pull the trigger. There is no explosion, but gravity causes the bullet to slide out of the barrel and bounce off your foot.

    Lisp : You do a small part of the remaining work involved in shooting yourself in the foot. You then call yourself, and tell yourself to shoot yourself in the foot.

    Pascal : The same as Ada, except when you pull the trigger a little sign pops out reading "BANG!".

    C++ : The same as Java, except you try to build the parent water pistol using the gun tools from the C gun. When you pull the trigger on the child gun, the parent C gun explodes, spraying water everywhere, including the chamber of the child gun. This causes the child gun to backfire, blowing your head off.

    Visual C++ : The same as C++, except that the bullets, the gun parts, the tools you use to put it together, the hospital you get taken to afterwards, and the ambulance that takes you there are all owned by the same company.

    APL : Whenever you pull the trigger, no matter where you aim the gun, the bullet ricochets off of 13 objects and lodges in your foot. The gun has been examined by ballistics experts, mechanical engineers, and even the person who made it, and none of them can figure out how it works.

    FORTRAN : When you aim the gun at your foot and pull the trigger, a table indexing error causes the gun to shoot its firing pin into your foot instead of the bullet.

     

     

     

     

    Wednesday, November 26, 2008 4:21 AM
  • User511787461 posted

    Have you looked at fastcgi.h at various places, eg here - that is really the canonical fastcgi interface and that is what any fastcgi server/client uses/understands - all other APIs are built on top of that to provide various ease-of-use advantages etc, but if you really want the basic fastcgi C API, that is it.

    Wednesday, December 3, 2008 5:14 PM
  • User-1910087654 posted

    This header is written by: 

    1995-1996 Open Market, Inc

     Where is the MSDN API description that I could work from?

    I need to understand what would be the minimum requirement to write to this API in terms of functionality?

    Please do not send me to the fastcgi website as that is where this problem begins.

    Where is the MS documentation fo this API?

    Friday, December 12, 2008 2:58 AM