Include Perl file in PHP on Apache

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
salto
Forum Commoner
Posts: 31
Joined: Thu Jul 04, 2002 7:50 am

Include Perl file in PHP on Apache

Post 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.
Post Reply