in reply to Execute command
Most likely your web server is providing a different environment to the scripts it runs. If you check the web server's configuration, you may be able to find its settings on that environment, including PATH. However, it's usually best to use absolute pathnames, as already mentioned by hippo.
my $output = qx "php -l -d log_errors=0 $pName";
What is $pName? If it's anything derived from user input, then this is a massive security hole, see my post about this here. Even if it's not user input, it should be escaped properly to avoid potential issues with shell metacharacters. Since you say this is Windows, I would at the very least use Win32::ShellQuote to quote that command! For example:
use Win32::ShellQuote qw/quote_system_string/; my $output = readpipe(quote_system_string("php","-l","-d","log_errors= +0",$pName));
|
|---|