Perlscript wont run correctly if exec’d by php.

Hi guys,
I have a perl script that connects to cisco routers using the net::appliance::session module.

It takes 3 arguments ( host , dbid, username )

It then connects to the host
Reads the config from the DB based on the ID
Adds the config to the router.

This works FINE! if i call it from the cli however if i call it from php it just fails to connect to the device.

I assume this is some kind of permission issue or something else odd going on.

Ive tried calling it like:
$output = `perl /var/www/cgi-bin/config/apply.pl $host $idref lynxus`;

echo exec("cd /var/www/cgi-bin/config/; ./apply.pl $host $idref lynxus");

BOTH work and call it ( i start to get output ) but the connect part of the perl script fails.

Any thoughs what could be wrong?

Scr: /var/www/html/configure # ll /var/www/cgi-bin/config/apply.pl
-rwxrwxr-x 1 root root 1948 Oct 26 07:54 /var/www/cgi-bin/config/apply.pl

View full post on Webmaster-Talk.com

, , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved