I am using the following statements to execute a Perl script from a web site using PHP.
$perl = shell_exec('perl '.$dest.'/script.pl 2>&1 '.$mail.' '.str_replace("/", "\\", $dest));
I want to run the script server side, but it seems that it uses the Perl that is installed on the client so someone that has not installed Perl could not run the script.
I can't figure out what I am missing.
EDIT: I run:
$perl = shell_exec('C:\Perl\bin\perl.exe -v');
and figure out that was Perl server side running. So now I have to understand why some clients can't execute script.
EDIT 2: It is definitely a permission issue, only administrator could write. I' ll manage the permission.
$destand$mailcome from? If they come out of parameters to your PHP program and you have not properly sanitised them, you could introduce a massive security problem. A malicious person could for example submit the string" && rm -rf foo #", wherefoocould be any directory. This is similar to SQL injection, but potentially way worse as an attacker could delete potentially your whole server.