script run as apache from web page fails.

  • I have created a php site that allows a user to execute a perl script.
    When I run a script as apache user from command line, it works fine but when I run it from the web page, the script runs and it dies saying: problem connecting to "switch1", port 23: Permission denied at /var/www/html/scripts/ line 40
    line 40 contains $session = Net::Telnet::Cisco->new(Host => "$switch");
    this is where I use a Net::Telnet::Cisco module to telnet to a device.