antianti Posted August 23, 2007 Share Posted August 23, 2007 Hey everyone. I've run into a problem working on a "live" update system for a website I'm working on. The idea is that I add/upload a zip file on a central host, with all the updated/new files for a running site, and then the admin of the running site can install the update. I've got it so the zip is opened, running through the files in the archive. For each file it opens the existing version with fopen, replaces the content, then closes the file. That works pretty good, but the problem comes when a new file is found in the archive. When I fopen() to create a new file, the ownership and permissions are different than for the files I uploaded manually via ftp. And I can't execute the scripts created this way. I've found that php Safe Mode is switched ON for my host, and I can't do anything to change that. Neither is a change of host possible at the moment. Anyone here with a good suggestion on how I handle the updates if I can't get it to create new files? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/66346-update-system/ Share on other sites More sharing options...
frost Posted August 23, 2007 Share Posted August 23, 2007 Can you use PHP to CHMOD the needed scripts/directories? I am not to familiar with the limitations Safe Mode sets... Quote Link to comment https://forums.phpfreaks.com/topic/66346-update-system/#findComment-332051 Share on other sites More sharing options...
antianti Posted August 23, 2007 Author Share Posted August 23, 2007 Ah, sorry, some more explanation. No, I can't chmod/chgrp them to get the properly set on ownership and permission, so I can't execute them as scripts, or include them in other files. That is when I create new ones with fopen() or touch(). Also, to nail it all down, php version is 4.4 and the webserver Apache 1.3.37. Quote Link to comment https://forums.phpfreaks.com/topic/66346-update-system/#findComment-332070 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.