WordPress FTPS is not SFTP

Is WordPress giving you server errors when you try to update or upload themes? Are your only two options FTP and FTPS (which is not SFTP)? Here’s how to fix that, make WordPress work with SSH, giving you an SSH2 option for updating. And it works.

A major shout of thanks goes to Jon for his WordPress post entitled Enabling SSH/SFTP Updates.

I’d been struggling with making WordPress updates work properly for the longest time, setting up file ownerships and permissions. Things always seemed to be mostly right. If I tried to do an update of any form, I’d see this:

Error: There was an error connecting to the server

WordPress offers FTP and FTPS (SSL).

I’d try the secure option and things just would not work. Then I’d go examine my SFTP connections and my SSH, and it’d all be working fine.

It took bdawson‘s post on FTPS vs. SFTP to make me realize I was so falling into the habit of typing STFP that I didn’t realize that wasn’t what WordPress was offering!

With Jon’s post, enabling SFTP in WordPress becomes trivial.

  1. # apt-get install libssh2-php
  2. # /etc/init.d/apache2 restart

The SSH2 option then presents itself, and all is right in the world. Thanks guys!

Code Markup for WordPress

I’ve been looking for a decent code markup plugin for WordPress so that I can include source code fragments in WordPress.

Problem is, using <CODE> tag in conjuction with <PRE> injected extra blank lines ( <BR/> ) into the code.

Using Code Markup, I was able to do it.

But there was a trick…

First, the plugin requires that the <code> tag be in lowercase. Internally, I was using uppercase so it’d stand out visually to me. In theory, HTML tags ought to be case insensitive, but the filter required them. I’m going to look at this as a “good thing” since it allows me both worlds. I just wish I found it by a means other than clever guesswork.

Second, if you want spaces preserved, you need to put your code block inside of a <pre> tag. This is actually well documented on the Code Markup site.

Third and finally, do not go sprinkling HTML entities like &amp; in your code; let the filter do it for you.