ExifTool Forum

ExifTool => Newbies => Topic started by: pizzipie on July 13, 2023, 10:36:31 PM

Title: exiftool will not work using php exec($cmd, $output) when dir is on CD
Post by: pizzipie on July 13, 2023, 10:36:31 PM
Hi,


When using using PHP and the source dir is on media(DVD) I can't get exiftool to work.


$cmd='exiftool -s -@ ./myargs.txt -json /media/rick/PollyPics/Pictures-Vista/March8_2005/*';

exec($cmd, $output);

echo "out ". gettype($output);

myprint($output);

out array

Array
(                <============= NOTHING HERE
)

I have to send the output of exiftool  run on the browser to a json file on my hard drive (pic.txt) first and then I can  manipulate the exiftool output with PHP.


 exiftool -s -json -@ /home/rick/DBases/Dbmysql/experiment/exiftools_php/myargs.txt /media/rick/PollyPics/Pictures-Vista/March8_2005/ > /home/rick/Desktop/PollyPics/pic.txt

    1 directories scanned
    4 image files read
[/tt]

Help with this is greatly appreciated. I am very in-experienced using exiftool so please be detailed (ie: basic details are needed.)

Thanks, R
Title: Re: exiftool will not work using php exec($cmd, $output) when dir is on CD
Post by: StarGeek on July 14, 2023, 03:50:26 PM
What is the contents of myargs.txt?

Exiftool should at least output a json with "SourceFile" entry unless it is unable to execute properly.

What is the result if you add result_code variable?

exec($cmd, $output,$rc);
echo $rc;
Title: Re: exiftool will not work using php exec($cmd, $output) when dir is on CD
Post by: Phil Harvey on July 14, 2023, 09:19:02 PM
You should make sure your command works at the command line and figure out any problems there before trying to run it from PHP.

- Phil