Esql/C Problem.....HELP~~~ 
Author Message
 Esql/C Problem.....HELP~~~

Hi, all,
I use Informix SE on LINUX,  and I found a problem.

I write an easy EC program(nothing about sql) and
compile it to execution file. It can run well under linux command,
but if i run it on web browser, it don't work(never have output).

But if I rename it to "tt.c" , and compile it to an execution file.
It can run well on both linux command and the web browser.

I don't know why? It is the same C program and nothing about SQL,
just compiled by different C compiler. Why one can execute on web browser,
and the other can't?

Anyone knows? Does any parameter I need to set on linux for web?
Thanks...

Peary

Here is my program,  "tt.ec"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main(int argc,char *argv[])
{
        printf("Content-type:text/html%c%c",10,10);
        printf("This tests the output of C on WEB...\n");
        /*printf("%s",argv[1]);*/
        return;

Quote:
}



Wed, 18 Jun 1902 08:00:00 GMT
 Esql/C Problem.....HELP~~~

Peary

You probably need to set the LD_LIBRARY_PATH in your webserver (I think
srm.conf in Apache). Also if you are doing some sql calls you also need the
other Informix variables, such as INFORMIXDIR,
PATH(=$INFORMIXDIR/bin:$PATH), INFORMIXSERVER and ONCONFIG.

HTH
Sujit




cc:    (bcc: Sujit Pal)
Subject:  Esql/C  Problem.....HELP~~~

Hi, all,
I use Informix SE on LINUX,  and I found a problem.

I write an easy EC program(nothing about sql) and
compile it to execution file. It can run well under linux command,
but if i run it on web browser, it don't work(never have output).

But if I rename it to "tt.c" , and compile it to an execution file.
It can run well on both linux command and the web browser.

I don't know why? It is the same C program and nothing about SQL,
just compiled by different C compiler. Why one can execute on web browser,
and the other can't?

Anyone knows? Does any parameter I need to set on linux for web?
Thanks...

Peary

Here is my program,  "tt.ec"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main(int argc,char *argv[])
{
        printf("Content-type:text/html%c%c",10,10);
        printf("This tests the output of C on WEB...\n");
        /*printf("%s",argv[1]);*/
        return;

Quote:
}



Wed, 18 Jun 1902 08:00:00 GMT
 Esql/C Problem.....HELP~~~

Quote:

> Hi, all,
> I use Informix SE on LINUX,  and I found a problem.

> I write an easy EC program(nothing about sql) and
> compile it to execution file. It can run well under linux command,
> but if i run it on web browser, it don't work(never have output).

> But if I rename it to "tt.c" , and compile it to an execution file.
> It can run well on both linux command and the web browser.

> I don't know why? It is the same C program and nothing about SQL,
> just compiled by different C compiler. Why one can execute on web browser,
> and the other can't?

Curiouser and curiouser!  Actually they are compiled by the SAME C
compiler.  Esql is just a shell script that runs the precompiler and
preprocessor steps then runs the C compiler, indeed you can pass it
.c files and .a files and it will skip the ESQL preprocessor and just
run the C compiler for the .c files and the assembler for the .a files!  
Look in the esql script for the value of INFORMIXCC and see what it
thinks the name of the C compiler is.  It may be that you are running
egcs when you compile C manually but esql is executing the value of
INFORMIXCC which might be cc or gcc.  You CAN modify the default in the
script or set INFORMIXCC in your environment (or in /etc/profile for
all environments) if this is the case.

If you pass the renamed .c file to esql instead of to gcc directly then
surely it should work just as it does with gcc.  If not then there is
surely a problem, expecially is INFORMIXCC is set to the command you
are using to compile .c files.

Art S. Kagel



Wed, 18 Jun 1902 08:00:00 GMT
 Esql/C Problem.....HELP~~~

Quote:

> I use Informix SE on LINUX,  and I found a problem.

> I write an easy EC program(nothing about sql) and
> compile it to execution file. It can run well under linux command,
> but if i run it on web browser, it don't work(never have output).

> But if I rename it to "tt.c" , and compile it to an execution file.
> It can run well on both linux command and the web browser.

> I don't know why? It is the same C program and nothing about SQL,
> just compiled by different C compiler. Why one can execute on web
> browser, and the other can't?

> Anyone knows? Does any parameter I need to set on linux for web?
> Thanks...

> Peary

> Here is my program,  "tt.ec"

> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> void main(int argc,char *argv[])
> {
>         printf("Content-type:text/html%c%c",10,10);
>         printf("This tests the output of C on WEB...\n");
>         /*printf("%s",argv[1]);*/
>         return;
> }

The usual answer to such questions is 'environment, environment,
environment'.  Since you linked with ESQL/C 7.24, you also got
a file from the ESQL/C libraries linked into your code, which in
turn probably causes some other ESQL/C shared libraries to be
added to the program.  You can tell this by running ldd on the
executable and seeing which Informix libraries show up.  If I'm
correct (90% confident), then you need to set LD_LIBRARY_PATH or
juggle with /etc/ld.so.conf.  And that means rebooting the
web server after adding some SetEnv or PassEnv directives.

--

Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>



Wed, 18 Jun 1902 08:00:00 GMT
 Esql/C Problem.....HELP~~~
I have set the LD_LIBRARY_PATH in /etc/profile
and it don't work....
Did I set it to the wrong file?
Where should i set LD_LIBRARY_PATH?

Thank you...
Peary

Quote:

> The usual answer to such questions is 'environment, environment,
> environment'.  Since you linked with ESQL/C 7.24, you also got
> a file from the ESQL/C libraries linked into your code, which in
> turn probably causes some other ESQL/C shared libraries to be
> added to the program.  You can tell this by running ldd on the
> executable and seeing which Informix libraries show up.  If I'm
> correct (90% confident), then you need to set LD_LIBRARY_PATH or
> juggle with /etc/ld.so.conf.  And that means rebooting the
> web server after adding some SetEnv or PassEnv directives.

> --

> Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
> #include <disclaimer.h>



Wed, 18 Jun 1902 08:00:00 GMT
 Esql/C Problem.....HELP~~~

Peary

You can set the LD_LIBRARY_PATH in your conf files and restart the
webserver. For example if you are using Apache (1.1 or later), then you can
add this in your httpd.conf file:

SetEnv LD_LIBRARY_PATH your-ld-library-path

and restart the webserver. The command is:

/your-apache-dir/bin/httpd stop
/your-apache-dir/bin/httpd start

BTW, I will try to mail out the start script tonight.

HTH
Sujit




cc:    (bcc: Sujit Pal)
Subject:  Re: Esql/C  Problem.....HELP~~~

I have set the LD_LIBRARY_PATH in /etc/profile
and it don't work....
Did I set it to the wrong file?
Where should i set LD_LIBRARY_PATH?

Thank you...
Peary

Quote:

> The usual answer to such questions is 'environment, environment,
> environment'.  Since you linked with ESQL/C 7.24, you also got
> a file from the ESQL/C libraries linked into your code, which in
> turn probably causes some other ESQL/C shared libraries to be
> added to the program.  You can tell this by running ldd on the
> executable and seeing which Informix libraries show up.  If I'm
> correct (90% confident), then you need to set LD_LIBRARY_PATH or
> juggle with /etc/ld.so.conf.  And that means rebooting the
> web server after adding some SetEnv or PassEnv directives.

> --

> Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
> #include <disclaimer.h>



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. Problem with Delphi3 CS and Sybase 11 - HELP please

2. ESQL problem...anyone else having problems with ESQL?

3. Esql 4.1 update to esql 7.3 any problem ?

4. Delphi 2.0 CS Update & BLOB Problem

5. D2, IB-cs application problem

6. Delphi 4 CS and Oracle 8 problem.

7. problem: .NET Data Provider for Oracle and OracleHelper.cs

8. Delphi CS 1.02 to Sybase Help

9. Help: source of CS-Library error 2/4/1/54 -cs_convert...The non-map replacemen

10. Help -- ESQL C problems

11. ESQL 7.1 client versus 5.0 Server:Problem...Help

12. Help - ESQL/C linking problems


 
Powered by phpBB® Forum Software