Board index » delphi » Delphi CGI Problem - CGI Program Only Runs When Delphi Also Runs

Delphi CGI Problem - CGI Program Only Runs When Delphi Also Runs

Here's a strange one:

I have developed a CGI program written in Delphi.  It uses Ann Lynnworth's
freeware CGIEnvData component (thanks Ann!) and does some database access
to get the info it needs to produce its HTML.  The server is WebSite, running
on a Windows NT machine.  I compile the code on my Windows 95 machine, and
the executable gets written to the NT machine's cgi-win directory.

The intermitant problem is, that when I run the program from my web browser, I get the
message "Message: Failed to create CGI process" from the server.  If I log in to the
NT console and run Delphi and then quit Delphi, but stay logged in, the program works
fine, either on a local browser or a remote one.  If I log out, it stops working
again.

I copied the example program for CGIEnvData into a different program and ran
it, and it worked fine, without having to run Delphi.

The NT machine is shared by a number of users, so I can't just stay logged in.

Has anyone come across a similar problem?  And if they have, do they know of
a solution?  Thanks for any help or insights.

--
----------------------------------------------------------------------------
James B. Tubman                       Alberta Research Council
Program Leader                        Advanced Computing & Engineering Dept.
jbtub...@skyler.arc.ab.ca             3rd Floor
http://www.arc.ab.ca/                 6815 - 8 Street NE
Phone: (403) 297-2656                 Calgary, Alberta
Fax:   (403) 297-2339                 Canada T2E 7H7
http://akaela.arc.ab.ca/WWW/jbtpgp.html  -- PGP Public Key
----------------------------------------------------------------------------
"When I have a little money, I buy some books. And if I have any left over,
 I buy food and clothes."                                        -- Erasmus
----------------------------------------------------------------------------

 

Re:Delphi CGI Problem - CGI Program Only Runs When Delphi Also Runs


Quote
Jim Tubman wrote:
> The intermitant problem is, that when I run the program from my web browser, I get the
> message "Message: Failed to create CGI process" from the server.  If I log in to the
> NT console and run Delphi and then quit Delphi, but stay logged in, the program works
> fine, either on a local browser or a remote one.  If I log out, it stops working
> again.

It sounds as if you are running WebSite as an application as opposed to a service (I
know this problem because we do the same thing here.) Applications get closed down
when you log out of a machine, but services continue running. You will need to set
up WebSite to run as a service on the machine, or stay logged in all the time.

Greg Dunlap
Kallista, Inc
Who have nothing to do with whatever inanity you may have just had to read

Re:Delphi CGI Problem - CGI Program Only Runs When Delphi Also Runs


Quote
Greg Dunlap wrote:

> Jim Tubman wrote:
> > The intermitant problem is, that when I run the program from my web browser, I get the
> > message "Message: Failed to create CGI process" from the server.  If I log in to the
> > NT console and run Delphi and then quit Delphi, but stay logged in, the program works
> > fine, either on a local browser or a remote one.  If I log out, it stops working
> > again.

> It sounds as if you are running WebSite as an application as opposed to a service (I
> know this problem because we do the same thing here.) Applications get closed down
> when you log out of a machine, but services continue running. You will need to set
> up WebSite to run as a service on the machine, or stay logged in all the time.

Thanks for the response, Greg, but I was running WebSite as a service when
this was happening.  It is really puzzling.  However, I have WebSite 1.1 on
order and it is supposed to get here this week.  Perhaps that will solve the
problem, or give me some other clue about what's wrong.

--
----------------------------------------------------------------------------
James B. Tubman                       Alberta Research Council
Program Leader                        Advanced Computing & Engineering Dept.
jbtub...@skyler.arc.ab.ca             3rd Floor
http://www.arc.ab.ca/                 6815 - 8 Street NE
Phone: (403) 297-2656                 Calgary, Alberta
Fax:   (403) 297-2339                 Canada T2E 7H7
http://akaela.arc.ab.ca/WWW/jbtpgp.html  -- PGP Public Key
----------------------------------------------------------------------------
"When I have a little money, I buy some books. And if I have any left over,
 I buy food and clothes."                                        -- Erasmus
----------------------------------------------------------------------------

Re:Delphi CGI Problem - CGI Program Only Runs When Delphi Also Runs


In <30FE992D.4...@skyler.arc.ab.ca> Jim Tubman
Quote
<jbtub...@skyler.arc.ab.ca> writes:

>Here's a strange one:

>I have developed a CGI program written in Delphi.  It uses Ann
Lynnworth's
>freeware CGIEnvData component (thanks Ann!) and does some database
access
>to get the info it needs to produce its HTML.  The server is WebSite,
running
>on a Windows NT machine.  I compile the code on my Windows 95 machine,
and
>the executable gets written to the NT machine's cgi-win directory.

>The intermitant problem is, that when I run the program from my web
browser, I get the
>message "Message: Failed to create CGI process" from the server.  If I
log in to the
>NT console and run Delphi and then quit Delphi, but stay logged in,
the program works
>fine, either on a local browser or a remote one.  If I log out, it
stops working
>again.

>I copied the example program for CGIEnvData into a different program
and ran
>it, and it worked fine, without having to run Delphi.

>The NT machine is shared by a number of users, so I can't just stay
logged in.

>Has anyone come across a similar problem?  And if they have, do they
know of
>a solution?  Thanks for any help or insights.

>--
>----------------------------------------------------------------------
-----
>James B. Tubman                       Alberta Research Council
>Program Leader                        Advanced Computing & Engineering
Dept.
>jbtub...@skyler.arc.ab.ca             3rd Floor
>http://www.arc.ab.ca/                 6815 - 8 Street NE
>Phone: (403) 297-2656                 Calgary, Alberta
>Fax:   (403) 297-2339                 Canada T2E 7H7
>http://akaela.arc.ab.ca/WWW/jbtpgp.html  -- PGP Public Key
>----------------------------------------------------------------------
-----
>"When I have a little money, I buy some books. And if I have any left
over,
> I buy food and clothes."                                        --
Erasmus
>----------------------------------------------------------------------

-----

Try putting the BDE on the server and apecify the server path in the
BDE NET/DIR property.  Also add the server to the path on every local
machine.  Theoretically that should work.  I should be setting up a
similar situation in the next two weeks.  If you still have problems
please EMail me in a week or two and I should have a definite solution.

Ben
Arrow

Re:Delphi CGI Problem - CGI Program Only Runs When Delphi Also Runs


Quote
>> The intermitant problem is, that when I run the program from my web
>> browser, I get the message "Message: Failed to create CGI process" from the
>> server.  If I log in to the NT console and run Delphi and then quit Delphi,
>> but stay logged in, the program works fine, either on a local browser or a
>> remote one.  If I log out, it stops working again.

>It sounds as if you are running WebSite as an application as opposed to a
>service (I know this problem because we do the same thing here.) Applications
>get closed down when you log out of a machine, but services continue running.
>You will need to set up WebSite to run as a service on the machine, or stay
>logged in all the time.

Another option is to "servicify" your application using the servany tool that
comes with the Windows NT resource kit (available on ftp.microsoft.com)

David

--
David Brabant,             | E-mail: David.Brab...@csl.sni.be
Siemens Nixdorf (SNI),     | CIS:    100337,1733
Centre Software de Lige,  | X-400:  C=BE;A=RTT;P=SCN;O=SNI;OU1=LGG1;OU2=S1
2, rue des Fories,         |         S=BRABANT;G=DAVID
4020 Lige (BELGIUM)       | HTTP:   www.sni.de       www.csl.sni.be/~david

Other Threads