Page 1 of 1

Include Perl file in PHP on Apache

Posted: Sat Jan 22, 2005 9:21 am
by salto
I can include a Perl script on Apache 2.0.50, PHP 4.3.8 on Windows XP.
The script runs perfect with this code

Code: Select all

<?php

if ($_GET) &#123;
$pl = "";
foreach($_GET as $key => $val)&#123;
if (! $pl=="" ) $pl = $pl . "&";
$pl .= "$key=$val";
&#125;
virtual ("somescript.pl?$pl");
&#125; else
virtual ("somescript.pl");
?>
(Page and somescript.pl are in the same directory)

However, on Unix, Apache 1.3.29, PHP 4.3.10 I get an error

Warning: virtual(): Unable to include
'/usr/www/users/path_to_somescript.pl' - request execution failed in line
nr...

pointing to this line in the script above :

Code: Select all

virtual ("somescript.pl");
Inclusion of a plain text file works fine, so there seems to be no trouble
with the include in itself.
somescript.pl runs fine in Perl mode, so no problem there.

I tried to use

Code: Select all

virtual ("'/usr/www/users/path_to_somescript.pl?$pl");
&#125; else
virtual ("'/usr/www/users/path_to_somescript.pl");
as well, to no avail.

Any advice to solve this problem for the Apache server on Unix?
Any help most welcome, thanks for your attention.