Team Environment Setup and Remote Working - php

We are working on a project which is getting bigger and bigger.
Till now our work looked like this:
I have a web server, I'm coding with VIM directly over SSH
Another programmer send me new files I add them and integrate them (he have a copy of project and local server)
Designer sends me design I also integrate it.
It is pretty much waste of time, because every time they made change I have to integrate it.
Now we have a hosting which doesn't support SSH (I cannot use vim now). How should we work on a project like this? How should I set up my VIM to work on remote project (I don't want to download and upload every time I want to change file)?

You didn't mention your OS. That would be certainly hepful if you want a precise answer.
The first thing would be to find a better host. You can rent very decent dedicated servers for as low as 40 or 50 € or less. If your project is big and serious, 50 €/month or 100 €, or 200 € is perfectly acceptable and you can install/enable whatever you need. Depending on the size of your project, a VPS could be enough. Whatever the price, a web host without SSH access is worse than shit.
But you may not have any power on that area.
Since your server doesn't support SSH, a proper VCS is not an option. The only practical solutions I see are rather "old-school" but they work:
Solution A:
Download the whole site on your local machine with an FTP client.
Edit locally.
Test your changes with a local web server.
Upload the changed files when your tests are OK.
Solution B:
Connect to your server with an FTP client.
Use its "Edit Locally" feature to open the files in Vim.
Write your changes, the file is automatically updated on the server.
Solution C:
Use Vim's bundled netrw plugin: :e ftp://host/path/to/file. See :h netrw.
Note that the process will always be download -> edit -> save -> upload, whether you notice it or not. Depending on the solution you choose, the process can be horribly repetitive and inneficient or almost completely invisible.
But, seriously, get another server and use a VCS and a local server.

I recommend using version management software like git with SSH hooks that automatically upload changes to your server.

You can use a version manager, like git and make a git pull in the web server every time you have a stable version.
You collaborator can push the new content and you dont need manage the file youtself.

Related

Development environment

I got kind of a problem, I can't figure out.
I got a local development server set up in my office and an other online dedicated server, to test my web-apps on.
That's all fine as long as I work in my office and use the LAN/WLAN.
But sometimes I'd like to do some quick code changes at home. There's where my problem starts. I tried several possibilities. FTP, VPN, WebDAV, ...
It does work, but the speed is incredibly slow. I need 5 min to chance one or two lines of code.
How's your development environment set up and what option should I use to make the "connection" become faster?
Thank's in advance
Typically extreme slow downs like this are due to the IDE you are using. It wants to read and parse everything in the "project" for you, and it is doing that over a slow connection (ftp, sftp, ssh, etc.).
If you are using dreamweaver, check out this KB Article and this Google Search.
Ultimately, you are going to have some performance hit, but you should be able to configure your IDE to minimize that. You can also always drop back to using something like FileZilla or WinSCP plus your favorite editor ... perhaps Sublime Text with Remote Access.
Trying to do dev over remote file system access is painfully slow. A few options:
Use Remote Desktop (RDP) to connect into your machine and do local dev.
You can always go the skydrive / google drive / dropbox route that syncs your dev files to your home computer so you can have local copies on both.
Don't discount source control (though with that you can only make updates to what was checked in, so if you left the office without a checkin, you won't be able to do anything about it from home).

File Sync with FTP Server

I have a Website with an FTP Server in BigRock.com. What my issue is, whenever there is a deployment, i will have to manually search and find all the files that need to be changed. Now the project is getting larger and larger and making these kind of changes is taking a lot of my valuable time.
So is there any Software/Tools available for Syncing with the FTP Server and changing files based on changes made locally? I am not sure about FileZilla Client since i couldn't find much options in it. I am pretty sure that there would be some solution for this. My project is done in Zend Framework with Doctrine ORM and Many other Libraries.
If you need a one-way synchronization from local files to server, you can check this free tool: http://sourceforge.net/p/phpfilesync/wiki/Home/
It could not be much easier to install or use.
try Allway Sync
It uses innovative synchronization algorithms to synchronize your data between desktop PCs, laptops, USB drives, remote FTP/SFTP servers, different online data storages and more. Encrypted archives are supported. Allway Sync combines bulletproof reliability with extremely easy-to-use interface.
url http://allwaysync.com/
I tried personally is working fine for ftp and local file sync. and also it is free..
Working with Assembla, i found the FTP Tool in it.
Here is the reference link,
http://blog.assembla.com/assemblablog/tabid/12618/bid/78103/Deploying-a-Web-site-is-easy-with-Assembla-s-FTP-tool-Video.aspx
Its Easy to Work Out,
Add the FTP tool using the Tools section of your Admin tab.
Deploy code to any server with ftp or sftp installed.
Set the deploy frequency to manual (you push a button) or schedule automatic deployments for every commit, hourly, daily, or weekly.
Only changed files are deployed for fast and accurate deployments.
Easily roll back and deploy prior revisions.
Add multiple servers for staging and production releases or simply to deploy different repository directories to different locations.

What is the simplest way to work on a project from different computers?

I have two computers that I use for development, one at home and one at the office. I use Aptana Studio 3 on both machines and would like to be able to easily work on a single project from both computers.
What are some easy ways to transport the project between computers. Right now I am just using a USB drive to transfer the files between computers.
Also, I'm using a local apache server on one computer, and a local IIS server on the other.
I think you should use something like SVN, GIT, Mercurial and so on. I suggest you this software to manage your project:
Tortoise
You might try connecting remotely (via Remote Desktop Connection for example) from home to the office computer and in this way you will only work on the office one and there will be no need for file transfer.
Alternatively, you can setup a source control server (by using SVN for example) and commit your projects to it. This way, you will be able to work on them from multiple locations.
if you have the opportunity to use a (virtual) server, and remote desktop from both computers, you won't come back to another solution. Overall with a server-side language like php, it's ideal, as you have your repository on your test web server (lamp/wamp) directly. That ensure ONE version for all your tools, easy and faster backups, synch, etc.
If I had no access to a virtual remote server, I would use github as an alternative, for the sake of code base security, and decent synch times. But I'm no expert on github.
Staging Environment
The best situation in your case will be to have a separate staging machine which is accessible to all three development machines. This can be another machine you control, one of the development boxes available to all of the others, or an external host - you can get a dedicated virtual machine from cloud providers for as little at $10/month, or if your project is simple enough use a plain web host even more cost-effectively.
Source Code Manager
A source code manager is a good start - SVN is common and free. Git is another and can even be set up to do remote deployments. These tools will give you two benefits:
Shared code between all environments, always up to date
Protection against data loss and error - if something major breaks revert to a working copy
File Synchronization
Finally, a tool like Dropbox can synchronize your files across all three systems as you make changes. Again, this one is free and can be installed on most operating systems.

Is there any possible cacth a web screenshot in virtual server hosting with PHP?

I want catch web screenshots with PHP. Because I also need some process with PHP, I do not want use any on-line screenshot service. I am willing to renting a free hosting or a virtual server hosting which cost less than 20 dollars per year.
As I know, virtual server can not upload exe files (like url2bmp.exe, webshot.exe, webscreencapture.exe, etc). And they all use linux system (it can not use new COM("InternetExplorer.Application")).
So, is there any possible cacth a web screenshot in virtual server with PHP? Thanks.
as a possible alternative, you can check out this project: http://code.google.com/p/wkhtmltopdf/
You can do this with Linux, it is seriously tricky though. You need FireFox, imagmagik and VNC installed.
Basically you get Firefox to open a new window in a VNC display, grab the screenshot of that display with imagmagik and then save it as a thumbnail. The hard part about this is getting the VNC portion to work, especially with a headless setup. But it is completely do-able.
However, it will probably be a ton easier just getting a Windows VPS.
Doing a search, found this which might work:
Taking website screenshot, server-side, on a Linux rented server, free
Ah and here is the post about what I described above:
Command line program to create website screenshots (on Linux)
You can take automated screenshots of websites using an open-source tool like pageres. It can also simulate various resolutions, testing responsive layouts.
I'm not sure whether it's relevant that your website is coded in PHP, or that you're mentioning .exe files. Are you new to web development?

What is a good solution for deploying a PHP/MySQL site via FTP?

I am currently working on a web application that uses PHP and MySQL, but I do not have shell access to the server (working on that problem already...). Currently, I have source control with subversion on my local computer and I have a database on the local computer that I make all changes to. Then, once I've tested all the updates on my local computer I deploy the site manually. I use filezilla to upload the updated files and then dump my local database and import it on the deployment server.
Obviously, my current solution is not anywhere near ideal. For one major thing, I need a way to avoid copying my .svn files... Does anyone know what the best solution for this particular setup would be? I've looked into Capistrano a bit and Ant, but both of those look like it would be a problem that I do not have shell access...
I'm using Weex to synchronize a server via FTP. Weex is basically a non-interactive FTP client that automatically uploads and deletes files/directories on the remote server. It can be configured to not upload certain paths (like SVN directories), as well as to keep certain remote paths (like Log directories).
Unfortunately I have no solution at hand to synchronize MySQL databases as well...
Maybe you could log your database changes in "SQL patch scripts" (or use complete dumps), upload those with Weex and call a remote PHP script that executes the SQL patches afterwards.
I use rsync in production but you could do this:
Add a config table into your site to hold what level of DB you are currently at.
During development, store each set of SQL changes into a single file (I use something like delta_X-up.sql). These will stay in your SVN as well. So, for example, if you are at delta_5 and add a table between the current release and the new release, all the SQL needed will be put in delta_6-up.sql
When it comes time to build, export the repo instead of using a checkout. This lets you ignore all the SVN cruft that comes along since you won't need that into production.
Use Weex to push those changes into production (this would be were I would use rsync but you don't have that option). Call a remote script that checks your config DB to see what delta level you are currently at, parse the directory with you delta_x-up.sql files and see if there are any new ones. If there are, read them and run the SQL inside.
You can do a subversion export (rather than checkout) to different directory from your working copy, then it will remove all the .svn stuff for you

Categories