realnsleo
realnsleo

Reputation: 715

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 are requests on the file already causing php fatal errors. How can i avoid this? Please help. Thank you.

Upvotes: 1

Views: 1556

Answers (3)

user680786
user680786

Reputation:

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).

Upvotes: 1

Denis
Denis

Reputation: 85

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.

Upvotes: 0

aporat
aporat

Reputation: 5932

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.

Upvotes: 0

Related Questions