0
votes

(sorry for my english)

Im creating an online form that upon submission take all the data,create zip file (using ZIPArchive) and send email with all the data and included zip file. When i run the php script , it works just fine and zip file is attached to the mail.

problem starts when i use CRON to run the script.. The cron log file had this error:

Failure to create temporary file: Permission denied

so i need to add permissions to my cron file in order for the $zip->close() commend to work(i guess). that is the problematic commend.

I have no idea how im new to cron .

Im using openshift and i put my cron file in repo/.openshift/cron/minutely/cronSend.sh and as i said it works when i run it manually. thats the cron file:

php $OPENSHIFT_REPO_DIR/finSend.php

here is the php:

$res = $zip->close();
if ($res  !== true ){
   echo 'failed to close zip !! <br/>';die($zip->getStatusString()."\n")
;}
2

2 Answers

0
votes

does the user that CRON uses to create the file, has permissions to access the specified folder? is the root user or someone else?

-1
votes

assign permission to the folder where zip file is created