"...Remember being a youngster, mom or dad telling you "close the door"? Well the same applies to HTML ...."

Go Back   Webmaster Forums > Code Forum > CGI Perl Forum

Reply
 
Thread Tools Rate this Webmaster Discussion
Old 06-29-2010, 01:45 PM   #1
ebohatch
New User
 
Join Date: Jun 2010
Webmaster Discussions: 1
Rep Power: 2
ebohatch is on a distinguished road
perl not executing from PHP

I have a php module with the following:
<?php
echo "
<HTML>
<HEAD>
<TITLE>web Gallery</TITLE>
</HEAD>
<BODY>
<P>
web gallery
";
exec("perl simple.pl");
echo "
</p>
</BODY>
</HTML>
";
?>

It never executes the perl program simple.pl


If I run CMD it runs the program just fine??


I have a Win 7 system running following:
Apache/2.2.14 (Win32)
DAV/2 mod_ssl/2.2.14
OpenSSL/0.9.8l mod_autoindex_color
PHP/5.3.1 mod_apreq2-20090110/2.7.1
mod_perl/2.0.4
Perl/v5.10.1

To the begining of the PATH variable I haave added
C:\xampp\perl\bin;C:\Program Files\ImageMagick-6.6.2-Q16;

These were installed with Xampp.

Any help will be appreciated, I have some older php and perl modules that used to work (2006) with older Apache/PHP/Perl versions. but I am just getting back to them now.


ebohatch is offline   Reply With Quote
Old 07-17-2010, 03:01 PM   #2
xmassey
Senior Member
 
Join Date: Apr 2007
Webmaster Discussions: 98
Rep Power: 27
xmassey is a name known to allxmassey is a name known to allxmassey is a name known to allxmassey is a name known to allxmassey is a name known to allxmassey is a name known to all
Re: perl not executing from PHP

Hey,

Try adding the perl shebang to the beginning of the string.

E.g.
Code:
<?php
exec("/usr/bin/perl; perl simple.pl", $output); 
echo implode($output);
?>
If you just want to "print" the output of the perl script I find the easiest way is to use the include function (note that you must provide a "full" URL).

E.g.
Code:
<?php
$include_url = 'http://www.domain.com/simple.pl';
include($include_url);
?>
Chris
xmassey is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Webmaster Discussions
Thread Webmaster Discussion Starter Forum Replies Last Post
problem while executing perl script through browser sptr CGI Perl Forum 0 06-18-2008 06:49 AM
Executing the PERL CGI Script vicky_brsh CGI Perl Forum 1 07-28-2007 08:32 AM
Javascript executing perl? Nongolf Javascript Forum 4 05-11-2007 01:21 PM
Executing program sylvain HTML Forum 1 03-23-2002 02:07 AM


All times are GMT -5. The time now is 08:33 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.