Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

problem executing perl in php script

Links for php scripts

Moderators: macek, egami, gesf

problem executing perl in php script

Postby ashotar » Sun Sep 30, 2012 9:55 am

Hi all,

I'm having problem executing a perl script in php script.

I have simple php script which should execute a perl script:
PHP script is:
<?php
echo "ping started";
exec (`/var/www/html/ping.pl`);
?>

Perl script is:
#!/usr/bin/perl
#!bin/sh

print "perl started";
exec `ping 192.168.1.1`;

When I run command "php start.php" in command line it successfully runs ping.pl which in it`s turn pings to 192.168.1.1. I have "echo" in php script which should print "ping started" and "print" in perl script which should print "perl started". This is done just to be sure that perl is running. The interesting thing is that though it is running perl script and makes ping to 192.168.1.1(I'm checking it with "ps -A | grep ping") start.php output is only "ping started"(echo in start.php but doesn't print "perl started", print in ping.pl).

The actual problem is that when I try to run start.php from in a browser from a client PC it prints "perl started" but doesn't make ping(I'm testing it again using "ps -A | grep ping").

Could someone please tell why start.php runs ping.pl from a command line but not from a browser?

Thanks in advance,
Ashot.
ashotar
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Sep 29, 2012 7:19 pm

Re: problem executing perl in php script

Postby ashotar » Sun Sep 30, 2012 11:42 pm

Can someone finally tell me what em I wrong and where to look for?

It's already third topic I'm opening to have solution to my problems. But still no one reply.

Please Advice,
AshotAr.
ashotar
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Sep 29, 2012 7:19 pm


Return to PHP Scripts

Who is online

Users browsing this forum: TurnitinBot [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.