What to do if “WordPress can’t create an .htdocs file on my Mac”

One of the first things I wanted to do when I first got my MacBook was to install WordPress locally to use it as a development sandbox.

Even after following the tutorial at WP Candy I couldn’t get WordPress to work perfectly on the Mac. I uninstalled MAMP and tried using XAMPP, which I had used successfully on my PC. I had the same problem with both. First, you are not alone. (I was prompted to write this post when an EXPERIENCED developer friend had problems configuring WordPress properly on his brand new MacBook Air.)

After several futile Google searches and digging through the forums (http://wordpress.org/support/) I came up with this solution.

Symptoms

  • WordPress asks for an FTP password when trying to update a plugin. It wouldn’t take my login password, so I reverted to doing a manual update. It worked, but it’s not what we want.
    WordPress asks for FTP credentials
  • If you try to update your permalinks, WordPress chokes while trying tocreate an .htdocs file. It complains about not having permissions to write to the file:
    WordPress can't write to .htdocs file

Solution

Here is how I fixed the problem. I used the terminal to do this (I worked as a Unix Sysadmin for several years). (If there is enough feedback I might do a follow-up on doing it using the GUI an a mouse.)

1. Find the directory where the problem lives:

$ cd /Applications/XAMPP/xamppfiles

 

2. Check the permissions and ownership on the  htdocs folder:

$ ls -l

htdocs directory permissions

3. Find the username that your Mac knows you as. In my case it’s icet. I’ll use myuser for this example. Change the user and group of the folder. One command will do it; you will probably need to use sudo.

$ whoami
$ sudo chown -R myuser:staff htdocs

Change ownership of the htdocs directory

We’re getting closer but Apache still can’t write to the htdocs folder. We need to tell XAMPP to run Apache as someone else

5. Change to the directory where the configuration file lives:

$ cd /Applications/XAMPP/xamppfiles/etc/

6. Make a backup of the configuration file, then change permissions of the configuration file so you can edit it:

$ sudo cp httpd.conf httpd.conf.bak

$ sudo chmod 777 httpd.conf

7. Edit the User and Group lines in the httpd.conf file. I use vim because I’m already at the command line. The Mac’s built-in TextEdit application will work too.

$ sudo vi httpd.conf

7.1. Find the User and Group lines

#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User daemon
Group daemon

7.2 and change them so it looks like this (replace icet with your username from step 3):

#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
# User daemon
# Group daemon
User myuser
Group staff

httpd.conf after the fix

8. Stop and restart XAMPP

That should do it. You have given Apache the ability to write into the WordPress directory. It has worked fine for me for months.

Don’t do this on a production server! It probably introduces several security holes. Find a qualified server expert.

WordCamp Chicago 2011

I was lucky enough to share the stage with some cool people at WordCamp Chicago in July 2011. The slides from my presentation are available for download at http://maxim650.com/wcchi-2011. If/when the video from the presentation becomes available this will be updated with a link.

The before and after sites from the presentation are also available.

Web Hosting: Are You Ready for a VPS?

For the uninformed, A VPS has hidden dangers

You have a successful website (or blog).

Congratulations!

You installed WordPress, and found a cool theme.

You figured out plugins and widgets.

Best of all, you figured out how to bring traffic.

Take a bow and pat yourself on the back. I raise my drink to you, Rock Star of the Internet! But excess can bring a hangover…

Your site is so successful that your traffic is slowing other sites on your shared server. Your hosting company has suggested you switch to a Virtual Private Server (VPS).

You might think, “I got this far. I’ll save a few bucks and manage the VPS myself.” If you are truly a tech ninja this is fine, but there are hidden dangers with managing a VPS yourself.

PC users might appreciate an analogy.

Warning for Mac Users

Skip the bullet points ahead (you won’t believe them anyway).
Just put your dominant hand in a blender. It will be faster and will hurt less.

  • Imagine that you have a program that requires MS Access and a special framework to handle the network interface.
  • Your program won’t work with the plain vanilla version of those, it needs some add-on modules installed.
  • You have to manually install and configure the software and add-on modules.
  • In Iambic Pentameter. From a DOS prompt.
  • It’s all keyboard. No mouse. No drag-and-drop.
  • Undaunted, you search Google, but the only documentation you can find is at least 2 years old.
  • Oh, there’s no Undo button, either.
  • What about security? Or will you just leave the door to your house open with your wallet on the dining room table?

THAT is a Debian Linux VPS. I love the idea of open source software, and Linux is an incredibly powerful and adaptable system. But it’s also extremely complex and requires a lot of care and feeding, especially in the harsh environment of the Internet.

I’m new to the world of VPS, but I have a few questions I would ask before diving into it.

  1. Is your site or business bringing in enough revenue to support the higher server costs?
  2. Will they provide support (managed service), or do you do the heavy lifting yourself (unmanaged service)?
  3. Is it included with your monthly subscription, or is it by the hour?
  4. What flavor(s) of Linux do they provide?
  5. Can you find documentation for it?
  6. Do they have experience with the requirements of your platform or CMS  (Joomla!, Drupal, WordPress)?
  7. Do you have the knowledge to maintain a secure environment?
  8. Is it really worth your time (and sanity) to try administering your own server? (A: No.)

Share your experiences and other questions in the comments. I would love to learn what your experience has been.

Cold Feet and a Cardboard Sign

It was mid-afternoon on Christmas Eve, and I was walking reluctantly through the aisles of the store. Despite my best efforts, the Christmas spirit managed to find a crack in my armor: I couldn’t get the sight of that woman out of my head.

When I pulled into the parking lot, she was standing by the road holding a cardboard sign. A quick glance over my shoulder caught the words “Single Mom” and “Will work for Xmas.”

Completing my purchases, I requested cash back and stuffed it in my jacket pocket where I could reach it easily. I tossed my purchases in the back seat and started the car.

She stood on the snow piled to the side of the road, the sign held high before her face, like a shield to deflect the judgment of affluent shoppers. I pulled up to the light at the edge of the parking lot and pushed the button to open the passenger window. She didn’t move, and I wondered if she noticed me.

I called out, “Merry Christmas,” she lowered the sign and turned her head. Under her hood, her face looked older than I expected. I wondered how many kids she had, and how old they are. She started to climb down the snow bank, moving slowly, limbs nearly paralyzed from the cold. I leaned across the seat and stretched my arm out.

“My feet are so cold,” she said, reaching slowly in to accept my meager offering. I smiled weakly and nodded. The light turned green and I called out “Merry Christmas” again as I pulled away.

This encounter affected me. I spent a lot of time thinking I should have given her more money, wishing that my business had been in a better place. I thought that maybe I should have given her a ride somewhere, bought her some food, done something. But what?

After Christmas dinner, I told the story to a good friend over tea.

Never mind that it was Christmas Eve, why should anyone ever have to stand outside, shivering and shame-filled, hoping for a handout? How did our society fail?

My friend wisely pointed out that we are responsible for our own reality. We can’t control circumstances, but we do choose how we react to them. Our decisions and actions have consequences. This is true for everyone, including Sign Lady.

Is it sad that Sign Lady was begging on Christmas Eve?

Yes.

Should I (or any of the hundreds of other people who drove by that day) done more to help her?

Yes.

Did she have to wait so long to ask for help, or in such a dramatic fashion?

No.

There is a societal failure here, but it isn’t about charity, or lack of opportunity.

The failure is that our educational system doesn’t teach people the difference between self-esteem and pride. People equate being wrong or asking for help with weakness. I know many smart people who mistakenly believe that being wrong is a failure. How many more believe that they should be able to do everything by themselves?

The reality is that asking for help fills a need: Givers need recipients. And you are worthy of help!

I needed a reminder of what it felt like to give. Sign Lady provided that.

I can’t know the circumstances that Sign Lady faced on her journey to the snow bank, but it’s a pretty safe bet that it took her a while to get there. She probably had many opportunities along the way to ask for help. Did a sense of pride hold her back?

Whether at work, school, business, or personal life, have you been reluctant to ask for help? In the last year I have struggled mightily with many areas of my fledgling my business because I thought “I should be able to do this myself.”

While I will probably make that mistake again, I am grateful for the reminders Sign Lady gave me.

  1. Givers need recipients.
  2. You are worth asking for help (and so am I).

I hope it’s easier for you to internalize those lessons than it has been for me.

Dear Lady with the Cold Feet and Cardboard Sign,

I don’t know anything about you, but I thank you. By doing what you did, you gave me a chance to give, something I desperately needed. You also reminded me that it’s OK to ask for help.

I sincerely hope your night and Christmas day got warmer, and that your future is filled with hope.

Now if I could just find a way to ease the guilt about not giving more…

Business on a Budget

It would be great fun to start this post with the phrase, “I’m often asked what tools I use as a web developer, so I decided to write a blog post to answer that.” It would also be an outright lie, so I won’t do that.

Tools have been on my mind the last couple days, largely because my laptop just died. Also, writing this post would be an effective way to get another entry in SolidSmack‘s HP EliteBook Giveaway (you can enter their contest until December 19th, 2010 so click the link). 🙂

I have seen that machine, and it is beautiful. With a suggested retail price of $4899 it’s a lot more money than most casual users could ever justify, but the cool factor is through the roof.

Since my focus is helping small businesses manage their websites, I will devote a few (dozen) lines of text to hardware requirements.

The Computer

Nearly any modern computer will do, as long as it has a decent (not dial-up) internet connection. If you can run Windows XP or later (and by later I mean Windows 7, not Vista) and run a decent web browser (Firefox, Chrome, Safari, even Opera, but please stop using Internet Explorer) you can manage your WordPress site. (I don’t have any experience with Macs so I can’t tell you how old one has to be before it’s too slow to be effective.)

Yes, a faster processor and more RAM will improve your Internet “experience” but the latest and greatest hardware isn’t critical unless you plan to edit a lot of photos, audio or video to support your website. If you have to buy one, a solid laptop will run you $500 to $600, but a $350 model will do the job. If you are on a really tight budget, a netbook will work, but they have other limitations.

Input Devices

If you are writing a lot of blog posts (and you should be if you intend to promote your business effectively), you will need to be able to enter information efficiently. That means typing and pointing and clicking.

Mouse

I will be blunt: touchpads suck. (Indignant Mac users may rant in the comments section.) Yes, newer ones let you scroll, but click-and-drag and right-click actions are hard to perform. Sleeves and palms brush them and screw up your typing. You shouldn’t have to concentrate on the mechanics of performing actions, you should just be able to DO them.

If you are working with a laptop or netbook, you must get a real mouse.

Just order plain coffee instead of a latte for four visits  and spend the $10 on an optical mouse with retractable cord. It will pay for itself in under an hour (unless you value your time at the U.S. minimum wage from 1987, in which case you should figure about three hours).

Keyboard

If you must take the bargain basement route, keep in mind that a netbook keyboard is smaller than a standard keyboard. It will take a touch typist a while to adapt to the smaller key spacing. Unless you are extremely comfortable with your keyboard or you do 100% of your work in coffee shops, get a keyboard to keep at your workspace.

I have spent enough years at computers that I have become a keyboard snob. (Most laptop keyboards put the delete key in the wrong place). I keep a full-size keyboard in the car, and yes, I do carry it into the library with me. (I’m more concerned with productivity and less worried about looking like a dork.) You don’t need a fancy ergonomic keyboard with buttons to launch email, control speaker volume, or start the espresso maker. Any decent office supply store will have a basic keyboard for $12 to $15.

Spend that extra money on yourself. You’re worth it.

The Monitor

If you think of your computer like a kitchen for concocting blog posts, then the monitor is your counter space. Can you imagine trying to cook a full-blown Thanksgiving dinner in a kitchen where the only counter space is 18 inches between the stove and the refrigerator? It can be done, but it’s not easy and it isn’t fun.

I have friends who do amazing amounts of work on a netbook, but they struggle with it:

WordPress can work with 1024 x 768 resolution in most browsers, but it’s tough. The menus on the left take a lot of space, and the editing box for writing posts is eclipsed by the control boxes on the right. There are workarounds, but the effects can range from mild annoyance to near-defenestration.

Just as adding counter space to your kitchen makes it easier to do more, adding screen space makes it easier to manage your blog.

If I’m a keyboard snob, I’m a monitor elitist.

You might be tempted to jump on the first deal you find for an inexpensive flat-panel LCD monitor. Before you plunk down your plastic, I suggest you check an under-rated specification: vertical resolution. Why? These screen shots show what writing this post would look like on different displays.

Note: Some images were cropped slightly to make up for the Windows menu bar. Also, other browsers (this is another reason to STOP USING INTERNET EXPLORER) leave even less room for your page, even before adding extra bloatware like the Yahoo! or Google toolbars.

Although not quite evil, monitor manufacturers have been doing something not very nice to boost sales: they dumb down displays to make them look like they are good for DVD movies. Yes, movies do fit nicely on them, but they’re less than optimal for creating content.

The reality is that most new widescreen monitors make your display a lot wider, but not much taller. If you can afford it, get a monitor with more vertical resolution. You will spend less time scrolling and more time doing important things.

Conclusion

Your website and blog should work for you, not the other way around. If you don’t live on the computer or edit photos or video for a living, you shouldn’t spend a lot of money on a computer. Sure, toys like HP’s new EliteBook make me drool, but I don’t do high-end CAD these days. A few dollars spent sensibly can help your website work for you without breaking the bank.

« Previous PageNext Page »