Whenever an active PHP based site I look after needs an urgent code change, I change the code offline, test it on my local server and then when happy, upload the updated file to the production server via FTP.
This obviously works, but I have found that when I do this on a busy site, if someone accesses the file in their browser at exactly the same time I am uploading, they will receive a PHP parse error. I assume that this is because the upload via FTP hasn't completed at the point when they try to access it.
I can't wait until a quiet period to upload my new files as the site is busy 24/7, so how can I avoid this? Do certain FTP servers handle this better than others or am I going about deploying to the production server in the wrong way?
CENTOS 6.6, Apache, ProFTPd/PureFTPd, PHP 5.3