It's not a problem per say, but it is an annoyance and I was wondering if there was a solution. For example, if I'm uploading a php file - sometimes the connection speed it slow and I try to access the file I get this: Parse error: syntax error, unexpected + the site location of the file. Is there any php code I can use so this parse error doesn't appear live on the site whilst uploading?
Yes trying to access it whilst uploaded. If I used that solution then there would be a delay/blank page deleting the old (index.php) file before renaming the new one...I don't think that would work plus I make many changes per day to the file.
Thanks but it's not compatible with my setup, out of interest which software do you use as my FTP setup won't allow me to rename a file if an existing file already has that name...
Just out of curiosity - how big is your index.php, or how crappy is your Internet speed if this is actually a problem? An index.php should upload in a couple seconds, at most.
I upload via FTP, it's Dreamweaver or something else - the file is an index.php file, uploading it as new-index.php and the renaming it to index.php won't work for me. The actual index.php file is about 250kb, but the file runs the whole site/pages.
Okay. A quarter of a MB for an index file is kinda insane. You should really look into how this is coded, and perhaps put some functionality in class files or separate functions. Seems a bit much.
Okay I'll look into it, the site is pretty quick though and things are called as/when they're needed... For Neroux answer, wondering if that's the best solution DP can offer?!
Don't use Dreamweaver, seriously. It's corporate garbage. Try using another FTP client, there are lots of free (and better) ones. Try using a different FTP daemon on the server side. ProFTPD, etc... Or ditch FTP altogether and use Git. Although, @PoPSiCLe has a point. Your index.php file should bootstrap your site, and not contain everything. Try spreading your code over a few more files, and include these whenever you need them.
This will happen no matter what. Filesize has nothing to do with it. All companies that I have worked with (even small ones) create a maintenance.html page, which while the updates to the website occur, it gives the users a nice message "Our website is being updated, please try again in a few minutes". Here is an example of how it could be done: http://davidwalsh.name/htaccess-maintenance-page-redirect
Yes, it will happen no matter what, but you can reduce the file size to decrease the amount of time. If there's a two second gap while you upload the file, it's not a big deal.
I'm not sure if you always upload only index.php but it seems so. In that case you can (by a batch script): 1) upload new-index.php 2) delete index.php 3) rename new-index.php It should be still faster than simply uploading new 'index.php' file. Or you can change your index.php script like this: <?php if (file_exists(__DIR__ . '/maintenance.txt')) { // or for example: file_get_contents(__DIR__ . '/maintenance.txt') ==="yes" echo "The site is in maintenance mode."; } else { include __DIR__ . '/your-original-index.php'; } PHP: I personally prefer deployment via git (for example http://krisjordan.com/essays/setting-up-push-to-deploy-with-git) but some setup is needed. Yet, it's definitely worth it.