Forum Moderators: coopster

Message Too Old, No Replies

Including the output of a CGI script locally

I have to use the full url currently, wasting bandwidth

         

donovanh

8:58 am on Jul 22, 2004 (gmt 0)

10+ Year Member



Hi,

I'm using a cgi script to generate content in part of my site. I had been using the virtual() command, however when I moved to a new host I found that virtual() is not supported and I needed to use include(). PHP is being run as a CGI.

The only way I can find to include() the script is by using the full url. While this works well, it seems to double my bandwidth usage, as the php script calling the cgi is counted as bandwidth. My concern is that if the site grows any more it could put pressure on my bandwidth limit.

Any suggestions on alternate ways to include the output of the CGI script?

Many thanks,

Don

JasonD

1:22 pm on Jul 22, 2004 (gmt 0)

10+ Year Member



Have you asked your host to enable virtual for your site?

I am afraid that include will do as you said and increase your b/w massively.

Span

1:32 pm on Jul 22, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some hosts do not support <!--#include virtual=" for cgi's.
Have you tried using <!--#exec cgi=" etc?

-Edit: Geez, ignore that. What am I doing in the PHP forum?-

donovanh

1:40 pm on Jul 22, 2004 (gmt 0)

10+ Year Member



Hi JasonD and Span,

Thanks for the suggestions.. My first step was to contact them and they suggested using return() instead of virtual(), which definitely does not work. I've tried exec() but it does nothing.

Is it possible for a host to enable virtual() on a site-by-site basis? Actually I'll ask my host and get back with any info they can provide. I agree that include() is burning up bandwidth, essentially I'm using twice as much as I should be :)

Don

donovanh

8:34 am on Jul 23, 2004 (gmt 0)

10+ Year Member



The host say they are 'thinking about it', when I asked them about alternates to virtual.

Are there any alternatives that don't rely on using the full URL? I really don't want to have to change hosts again, its hard finding a good UK host..

donovanh

10:48 am on Jul 23, 2004 (gmt 0)

10+ Year Member



I received this reply from the host:
The only reason that it worked before was that the previous server has PHP installed as an
Apache module. The virtual() function is not a standard function, it's specific to servers
running the mod_php system. For greater functionality with other PHP functions and better
security with PHPSuExec, we decided to install PHP as a CGI module instead.

Does this make sense? Is there any way to use virtual() or something similar in these circumstances?

Thanks,

Don