开发者

Help updating files on a live server

i'm developing a PHP web application that i recently launched into a remote shared hosted server. However, i'm constantly updating it using Dreamweaver on my development machine. Whenever i use PUT to update a file on the server for example config.php, i think at that same time there ar开发者_开发百科e requests on the file already causing php fatal errors. How can i avoid this? Please help. Thank you.


You need to find program, which will upload file with a suffix in the name (e.g. "filename.ext.!part") and only after uploading will rename existing file.
At this moment I don't remember existing solution, as variant you can try to play with this: http://winscp.net/eng/docs/script_commands

Another variant is using APC accelerator with apc.stat = 0 - cached copy of executable code of your scripts will be updated when server will restart. It's less comfortable way, of course.

Also, Dreamweaver isn't best IDE - try to use NetBeans (free) or PhpStorm (commercial).


I assume you're using FTP connection, which is probably the root of the problems. You can try switching to SSH connection, which is faster and secure way to upload files. You will have to ask the hosting company for SSH access, as it might be different credentials.

If you're looking for more enterprise php deployment solutions, we use phing to deploy applications (http://www.phing.info/trac/). Phing is using XML files and task to deploy apps, which might by an overkill for you.


RakeshS's answer is the wisest and safest one. Using a version system like SubVersion or GIT will also help copy many files quickly (just update the hosting server at once, without having to wait for many files to be FTPed and w/o forgetting any), and will help get back to the previous version at once in case of a blocking error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜