Remotely coding PHP without FTP
June 22, 2004 7:34 AM   Subscribe

I like to code my PHP scripts on my Windows machine in TextPad, then upload them to the server to test/debug them. But constantly FTPing files while debugging is the pits. What's the answer? Install PHP locally? Break down and learn to use vi? What's a programmer to do? What would you do?
posted by vraxoin to Computers & Internet (31 answers total)
 
learn vi. Admiteddly, its difficult at first, but a breeze once you get the hang of it.
posted by neilkod at 7:39 AM on June 22, 2004


I use emacs, there may be something similar in vi or your favorite editor. Well, not textpad.

I use something for emacs called "scamp". Prior to that I used emacs' ange-ftp. Both of these are methods for opening a file on a remote computer but editing it locally. When you save it automatically transfers info back to the remote computer and saves the file. For emacs, scamp is the clear choice, since it works with ftp, ssh, scp, ftp, sftp, telnet, etc. It's easy to add new methods if you have to. For example, at my work, you have to ssh to an ssh-gate computer and then from there to your real destination. Wrote a simple script and some emacs code to be able to open files through this kind of link.

Installing php locally is a good solution unless you need access to your remote database in which case it's only so-so.

Textpad is a no way to write programs, imho. I, and most other programmers I know, prefer a full-featured email editor, with nice doodads like syntax highlighting, macro facilities, advanced editing, folding, scripting ability blah blah.
posted by RustyBrooks at 7:39 AM on June 22, 2004


s/admiteddly/admittedly #doh!
posted by neilkod at 7:40 AM on June 22, 2004


Err... email editor? ;)

Don't laugh, but I use Dreamweaver. Seriously. The latest version has great support for php (including variable list popups, etc), regular expression-based search and replace, and it's v. easy to set up a site, hit Ctrl-Shift-U and upload the file you're working on.
posted by cheaily at 7:48 AM on June 22, 2004


webDrive, or ftpEdit may be what you're looking for.

I can't believe I've linked to webDrive twice in the same day. You're all going to have to believe that I'm not working for the man. Although if you're reading this "man", I could do with a free licence for my work (I already have a personal licence)
posted by seanyboy at 7:56 AM on June 22, 2004


I'm a big fan of vi, so I certainly wouldn't discount that.

Installing PHP locally doesn't seem like a bad idea either.

A quick shell script (or whatever) to push the file to the server might be sufficient. I'm sure there are scriptable windows ftp clients - if not, cygwin will provide what you need. I'm sure textpad has some sort of hotkey/external tool configuration where you could have it run this shell script with a single keystroke.

Or an NFS/SMB/whatever type share, where you could edit the same file that the server is using.
posted by mragreeable at 7:57 AM on June 22, 2004


I have Apache, PHP, and MySQL installed on my dev machine and they works (nearly) perfectly in unison. The Win32 binaries for each are quite stable and straightforward to configure, and it saves me the hassle of having to upload files constantly.

So long as your remote database server is properly configured, there is little difference between connecting remotely and connecting locally.

Changing your coding environment should only be done if you feel the new setup offers significant advantages over what you currently employ. vi has a rather large learning curve and may impact your workflow to an unacceptable degree. Personally, I loathe syntax highlighting, and find it far easier to read code in black and white than relying on a hideous rainbow to tell me the difference between a function and a variable.
posted by Danelope at 7:59 AM on June 22, 2004


Oh - And RustyBrooks. TextPad has ...
syntax highlighting, macro facilities and advanced editing.
It's a very good editor, and the one I've used for programming for the last 5 years. (at least)
posted by seanyboy at 7:59 AM on June 22, 2004


Also, some notes (which may not apply in the most recent versions of said programs):

1. The Win32 MySQL console doesn't support the tab completion of its *nix shell-based brethren. Tab completion is invaluable, so this hurts the most.

2. The MySQL process doesn't like to stop when told to stop. You sometimes have to fight with it (or reboot).

3. If you're looking for an SMTP server for Win32 (to test out PHP's mail() function, etc.), xmail works well with PHP. Nice tutorial here.

4. There's always pico.
posted by Danelope at 8:04 AM on June 22, 2004


Personally, I've been diggin' PSPad, which has a built in ftp client. Homesite+, if you don't mind shelling out some $$$, has an even better one. But yeah, to echo what those folks said above, running php/mysql/apache locally on a windows machine is actually a pretty nice way to develop.

Out of curiosity, though, do people really use the advanced editing functions you can find in PHPedit and the like? I dig syntax highlighting, but all that other stuff seems like overkill. (Syntax completion drives me crazy.)

Has anyone tried the Zend IDE?
posted by ph00dz at 8:06 AM on June 22, 2004


EditPlus has built-in FTP. saving yr remote files is as simple as "ctrl-S".
posted by danOstuporStar at 8:09 AM on June 22, 2004


What Danelope said. I have Apache, PHP and MySQL on a couple of Windows 2000 machines for development and it works fine. There are a couple of PHP commands that work differently (or not at all), but beyond that everything works fine. File deletion is the only one that springs to mind as having caused me platform headaches. The only real failing of this setup is if you need to build an app that integrates with a piece of 3rd party software like GPG or something.
posted by yerfatma at 8:09 AM on June 22, 2004


Pico? I love pico...
posted by cdavis at 8:10 AM on June 22, 2004


(without wanting to start another boyfilter thread, cdavis, are you aware that pico is spanish slang? :o)
posted by andrew cooke at 8:25 AM on June 22, 2004


Does windows have anything totally awesome like BBEdit? </cartmanvoice>
posted by rhyax at 8:26 AM on June 22, 2004


Yup, I use BBEdit's 'save to FTP server' all the time. Although I just switched to a host that supports WebDAV, (textdrive!) I might find myself using that more often.
posted by rschroed at 8:53 AM on June 22, 2004


By far, the best solution I've found: EasyPHP. Download, click install, it configures MySQL, Apache, and PHP for you on your Windows machine. Much easier and faster than FTPing.

I'm currently using it to hack my way through Wordpress.
posted by gramcracker at 9:34 AM on June 22, 2004


Response by poster: Since seanyboy can't seem to stop talking about it, I downloaded WebDrive, and it really seems to be the thing I was looking for, for the short term at least. Once my linux-fu improves, I'll probably set up my own local development server and develop directly to that, then upload finished sites when I'm done.
posted by vraxoin at 9:43 AM on June 22, 2004


Whoops on the email editor thing. Posting too early, etc. Text editor is what I meant.

Regarding textpad, I was thinking of notepad I guess. I don't know much about the actual application textpad. If it has scripting that is decent then there is probably a way to incorporate the ftp process into it. Ftp is an exceptionally simple protocol, I've implemented it in a variety of scripting languages at one time or another. Someone has probably already done it for textpad if it's possible and easy.

Should be pretty easy to write a shell script to do the same thing, also. Make an icon on the desktop linking to it, and just click that when you have an update. rsync is great for this (and comes with cygwin, which is a unix-like environment for windows).

If I am working on large chunks at once (i.e. not a lot of tiny edits) I often just use CVS for this kind of thing. Commit on the dev box, update on the server. I have this bound in emacs to a single keystroke so no big whoop. This has the added benefit of tracking changes. But, like I said, it's slow and annoying if you're, say, adjusting the location of some image pixel by pixel or something.
posted by RustyBrooks at 9:47 AM on June 22, 2004


Why no, I wasn't. Thank you for bringing that to my attention. Allow me to clarify: UW Pico (tm)? I love UW Pico (tm)...
posted by cdavis at 10:22 AM on June 22, 2004


My web host supports Samba. In windows, I map a network drive right to the ftp site. Then I work on the file right on the server in TextPad.
posted by jpoulos at 10:31 AM on June 22, 2004


Install PHP on your machine. It was an arse for me to do under XP (but a breaze on 98 for some reason). Try phpdev if you get problems.

Use Samba if at all possible.

Slightly OT, but I loathe Dreamweaver. It's better than it was, but it's HTML is very random. I'd rather hand code so I use Edit+.
posted by twine42 at 10:40 AM on June 22, 2004


Right, but the fact that people don't use other products doesn't mean the main product is a monopoly, does it? The definition of a monopoly is a company having exclusive control over a commercial activity. In contrast, Adobe has left the format of EPS, PS, and PDF VERY open. Anyone who wants to can make a reader or writer for them, and many people have. There are a half dozen readers for unix. libpdf is a library for creating PDFs that has hooks in every major programming language. Yes, adobe has a "lock" on it in the sense that everyone uses it -- but it's because their products are *good*, not because they stifle competition unfairly.

If you don't like adobe for generating and reading PDFs there are lots of other programs, most of them work very well.
posted by RustyBrooks at 11:28 AM on June 22, 2004


Whoops, wrong thread.
posted by RustyBrooks at 11:28 AM on June 22, 2004


Install PHP to work with IIS webserver, this gets rid of having to install Apache.
If you need a DB, install MySQL.

I like using Scintilla Text Editor (SciTE), it has color coding and code tips, which keeps me from visiting the PHP.net site whenever I forget in what order I'm supposed enter varaibles.
posted by linux at 11:33 AM on June 22, 2004


Install PHP to work with IIS webserver, this gets rid of having to install Apache.

But that's not necessarily easier. If I could never see IIS again, I'd be a happy man. Yes Apache has a learning curve, but once you get comfortable with http.conf et al, I think it's a much easier product to work with.
posted by yerfatma at 12:56 PM on June 22, 2004


Sigh.

UltraEdit, young master. You can save/load directly from FTP. It has kick-ass, extensible context highlighting (aka, PHP files have certain things highlighted certain colors, C files have other things highlighted certain colors, etc.)
posted by Civil_Disobedient at 4:18 PM on June 22, 2004


Seconds on UltraEdit. It's what I switched to from TextPad after finding built-in FTP abssolutely imperative.
posted by billsaysthis at 9:27 PM on June 22, 2004


I use Crimson Editor. Has all the highlighting I need and the ftp file support has never let me down. Plus it's free. Yay.
posted by Mossy at 9:54 PM on June 22, 2004


I also use Dreamweaver. MX 2004 has sftp built in, which is nice (no third party program like putty to go through). In addition to a local install of apache/mysql/php and you're good to go. I can't imagine how people create really complex sites using just a text editor. At the best, it slows you waaaay down (whether you think it does or not). At the worst, your site architecture suffers.
posted by pissfactory at 4:32 AM on June 23, 2004


Another vote for Editplus, though you should really learn vi as in some situations you won't have a choice
posted by BigCalm at 5:43 AM on June 23, 2004


« Older Clear Formatting in Word   |   What's the oldest modern rock song by The Beatles? Newer »
This thread is closed to new comments.