I'm trying to extract values from an LDAP server. I've a very basic script to grab these using the following:
*** START ***
my $ldapconn = Net::LDAP->new($ldap{host},port => $ldap{port},version => $ldap{version}) or die "LDAP error: $@\n";
my $ldapbind = $ldapconn->bind($ldap{admin},password...
Your 'pale idea' was spot on!
Added the following to the start of the script:
$ENV{HOME} = "/home/apache";
$ENV{USER} = "apache";
...and it all kicked in!
Many thanks.
Iain.
Apache is running as user 'apache' and has a homedir under /home. As mentioned, the script runs fine from shell. I can:
$ su - apache
$ ./script arg=value
...and all works great, pumping back all the HTML output as expected. It's only when the script is called via the httpd process (running as...
Have a script using Net::SSH::Perl that connects to remote machines and executes commands. Running the script via a shell as user apache returns as expected. When trying to run the script from a web browser (running as user apache) the script fails at the the line $session->login($user, $pass)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.