I am trying to get exiftool to work on my dedicated server. The problem is that PHP exec seems to work differently than when the command is run as a user. Oddly enough, PHP appears as the same user with whom I log in, but it does not behave the same with system commands.
Oddly enough, everything works fine on my localhost, but not on my server.
As already mentioned, executing exiftool commands registered in ssh is excellent.
But it works in php testing script (note that I installed exiftool for each directory under test, and it goes through ssh), nothing is available, although it works as an orangeman user ...
And he fails
Below is the update - it's all day:
On the shell:
-bash-4.1$ which exiftool -a
~/perl5/bin/exiftool
/usr/bin/exiftool
~/perl5/bin/exiftool
In php shell_exec('exiftool -a');
/usr/bin/exiftool
And here is what this file refers to:
lrwxrwxrwx 1 root root 33 May 15 02:10 exiftool -> /home/orangeman/perl5/bin/exiftool
I also tried creating symbolic links of different types by faking the main variable $ PATH through putenv();in php ... I'm really in the dark here. It works on the local host, and not on a dedicated server.
I updated this with generosity - this is a serious development problem.
I am on a dedicated server, and the problem is as described above.
UPDATE
At the suggestion of @gcb, I was able to print the error that occurs when the php function exec () runs the system command without effect.
Php
<?php
exec('exiftool 2>&1', $output, $r);
var_dump($output, $r);
?>
Conclusion:
array(2) {
[0]=>
string(230) "Can't locate Image/ExifTool.pm in @INC (@INC contains: /bin/lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /bin/exiftool line 33."
[1]=>
string(59) "BEGIN failed--compilation aborted at /bin/exiftool line 33."
}
UPDATE
Decision@gcb. Thank you very much.