简体   繁体   中英

using CRON with ZIPArchive object to create zip file— pemmisions denied

(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")
;}

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

将权限分配给创建zip文件的文件夹

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM