Reputation: 33
I have a command line that I run from a specific directory to resize images, but I now need it to run from a php script so I can put it into a cron job to automate. The command is mogrify -resize 800x800\> *.jpg
. I'm only looking for help to set up the php script, as I'm novice to doing this. Thanks in advance.
Upvotes: 1
Views: 110
Reputation: 77137
Cron has nothing to do with php. Have you tried putting
cd "$whatever_directory" && mogrify -resize 800x800\> *.jpg
in cron?
That said, you can get php to execute shell commands with exec
and shell_exec
, but I would urge you to consider if that's what you want.
Upvotes: 3