Tag Archives: Wordpress

Unable to Upload Files into WordPress on Localhost – OS X Apache

Came across a very weird bug in WordPress 3.7.1, which was not letting me upload any image/file through the Media Uploader. It was constantly giving the following error:

“logo.png” has failed to upload due to an error
Unable to create directory /content/uploads/2013/11. Is its parent directory writable by the server?
  • I tried changing folder permissions to 777; error.
  • Tried changing folder owner to _www; error.
  • Tried changing folder group to _www; error.

None of these solutions worked.

I have a custom folder structure, where wp-content has been renamed to content. So I turned to wp-config.php file. This is how it looks like in my wp-config.php:

define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/content' );
define( 'WP_CONTENT_URL', '/content' );
// Specify Uploads folder
define( 'UPLOADS', '/content/uploads' );

I tried changing the last line back to /wp-content/uploads (and renamed the folder), but still the same error! I was pulling my hair at this point!

Then I don’t know what occurred to me, and I commented out that last line. And voila! It worked!

Now I have no clue why explicitly defining the uploads folder was causing the issue, whereas on the WordPress Codex that’s exactly how the uploads folder – on a custom path – is supposed to be defined. Anyway, if anyone is having this issue in WordPress 3.7.x (or other versions), simply try removing this line from your wp-config.php file:

// define( 'UPLOADS', '/content/uploads' );

That’s all folks.

The Experience of Blogging – the Story So Far

Everybody was blogging. It was the new fad. Is that why I started blogging? Probably not.

I had a thing for writing since I was 14. Or at least that’s the age when I first got published in a ‘magazine for the young’ (Us). I got published multiple times after that with reviews and some funny stuff in the same magazine. But then computers and Internet happened, and I got hooked, leaving the writer in me with no option but to take a backseat. But as the Internet evolved, we saw the emergence of blogging – now anyone could write and publish themselves online, on their own web page (blog). I started blogging in 2005, on Blogger. I called it Guru’s World. I liked the Blogger platform overall. But then I wanted more control; I wanted my own domain name; and being a software engineer, I wanted to work on something more geeky … something that would help me learn programming (or something else that was related to my field) while I unleashed the writer in me. The answer lied in the open source WordPress. Upon acquiring the domain name SawantShah.com, I setup WordPress on it, called it “Zenning My Way Out” (just “Zenning” after about 2-3 years, and just recently renamed it to “Sawant Shah”), and I started blogging on this site in March 2008.

Continue reading

Tumblr excites me, as it makes blogging easier and fun!

I recently started a blog on Tumblr called Sawant’s Scrapbook and I have to confess, it’s a very slick blogging experience! Tumblr excites me!

Currently, Zenning (this blog of mine) is being served by WordPress, as it has been since its inception. So, even for a pro user of WordPress like me, Tumblr shows me that blogging can not only be easier (yes, easier than WordPress even) but it can be a lot more fun too!

From their about page:

Tumblr lets you effortlessly share anything. Post text, photos, quotes, links, music, and videos, from your browser, phone, desktop, email, or wherever you happen to be. You can customize everything, from colors, to your theme’s HTML.

It’s so much more easy (and did I mention fun?) to post on Tumblr that I am blogging there much more frequently than I do here at Zenning.

For now, I am utilizing my tumble blog as a scrapbook, where I post about anything and everything that I happen to land upon (mostly short posts)! It’s like my place of zen! My idea pad! My lab!! Whereas I will be posting the longer posts – the ones that are more analytical – over here at Zenning. I am pondering over the idea of merging the two, or at least, aggregating the two together.

The only drawback of Tumblr that I have so far come across is that comments on your blog can only be posted by Tumblr users! Now, that’s a major drawback for a service that is positioning itself as a competing blogging/micro-blogging platform against the likes of WordPress and Blogger.

But despite the drawback, I am in ♥ with Tumblr.

Do check out Sawant’s Scrapbook and follow me on Tumblr.

Blogging with Microsoft Word 2007

One of the tools that you can readily utilize for blogging is an offline software editor to write, edit and publish posts to your blog. One (new entrant) among such editors is Microsoft’s
Word 2007.

Supported Blog Providers/Engines

Word 2007 – a part of the Office 2007 suite – provides in-built functionality to connect to different types of blogging systems and perform editing and publishing tasks from within the very familiar interface of Word. Supported are some of the major blogging engines out there:

If your blogging engine is not in the above list, then Word also provides an option of ‘Other’, where you can connect to your blog through the API provided by your blogging engine. Consult your blog provider to check how to publish from a software editor, outside of you blog. Most bloggers would be pretty happy though, just like me, to find WordPress in that list.

Connecting to My Blog from Word

It was a breeze to connect Word to my WordPress blog. All I had to do was to provide the URL of my WordPress blog (relative to the xmlrpc.php file) and my username and password for the blog. That was it! Now I am composing this post of mine from within Word, and (if everything goes well) I will be successfully publishing it from within Word as well.

One Caveat

There is, however, one important thing that needs to be checked: the way Word formats HTML content, inserting its own markup and what-not into the code. This is the biggest issue when composing or copy-pasting rich-text from Word, or other word processors, into a web-based visual editor (such as TinyMCE). That is why word processors are generally avoided for HTML based content creation (not even for copy pasting) to the extent that it’s highly discouraged. I will edit this post after publishing to check what has been done with the code behind the visual layer: whether Word 2007 throws its own garbage into the code or keeps it clean and tidy XHTML.

Word 2007 Blogging Features

I will be writing a tutorial in my next post on how-to utilize Word 2007 to post on your WordPress blog. For now, a brief list of blogging features that are provided in Word2007:


  • Publish: Publish the post to your blog account
  • Publish as Draft
  • Home Page: Opens the home page of your blog in web browser
  • Insert Category: Categorize your post from the already defined categories on your blog account, or type a new one
  • Open Existing: Open an already published post on your blog for editing in Word
  • Manage Accounts: Add, remove or modify your blog accounts

Now that it’s time to publish, I realize that Word lacks the ability to tag my post! Tagging is now supported by WordPress and I love to tag my posts with the relevant keywords of the post rather than putting them in one or two generic categories. Now this step will need to be carried out manually. Oh well. Let’s publish.

WordPress Feed Issue: Blank line before XML declaration

Gosh! Yet another issue in my WordPress!

This is the third time in less than two weeks that I had to troubleshoot my installation of WordPress 2.5.

This time, however, the issue was not with WordPress itself, but this particular theme that I am using – Illacrimo. The feed for this blog was throwing an error:

XML Parsing Error: xml declaration not at start of external entity
Location: http://www.sawantshah.com/feed/
Line Number 2, Column 1:<?xml version="1.0" encoding="UTF-8"?>
^

I learned about the error when I tried to burn my feed through FeedBurner, which informed me that the feed (RSS XML) was not well-formed:

The URL you entered does not appear to be a valid feed. We encountered the following problem: Error on line 2: The processing instruction target matching “[xX][mM][lL]” is not allowed.

It directed me to Feed Validator to check the feed’s validity, and for sure it was not well formed:

line 1, column 1: Blank line before XML declaration

So what now? Google zindabad! On WordPress Support I found this and this, but I didn’t find any concise and to the point answer there.

I found a concise and workable solution on W3C’s site – check it out.

Why does this error occur?

If an XML declaration (<?xml ... ?>) appears in your feed, it must be the first thing in the feed, before any whitespace.

Unfortunately, with WordPress it seems all too easy for a plugin, a theme, or for your configuration file to contain a blank line. Further compounding this problem, some — but not all — feed readers compensate for this common error, allowing the error to go undetected for quite a while.

What’s the solution?

The solution is to trim/delete any blank lines outside of the <? ... ?> in the PHP code of either the theme files (functions.php) or WordPress files (wp-config.php, wp-rss2.php, wp-atom.php).

I had a blank line between two PHP code sections in the theme’s functions.php file. It was not evident at first, but thankfully, I finally got it to work! Now my feeds are working fine.

So go ahead and subscribe! :D

WordPress 2.5 – Yet another issue!

WordPress 2.5 is finally here, and I have upgraded to it from the initial Release Candidate 1 I had installed initially. WordPress is a blessing, and I love this new version!

But, after tackling with an issue in WP 2.5 RC 1, yet another issue was waiting to be tackled in this ‘final’ 2.5 version.

The issue was with TinyMCE Visual Editor. The Visual/HTML tabs were non-functional … in short, it was messed up (as seen in the image above. Image Source)!

I found a thread in WordPress Support on this issue, and this solution worked for me. Another post and solution here as well. Following is the solution that worked for me:

1. Compression is enabled on the server. If it’s set properly (in php.ini) the compressor for TinyMCE would detect it and not try to compress the js. To check for double compression: with Firefox, go to [your-site]/wp-includes/js/tinymce/tiny_mce_config.php. Should be a large text (js) file, starting with “var tinyMCEPreInit = …” and last line starting with “tinyMCE.init({mode:”none”,…”.

If it’s not – edit tiny_mce_config.php, looking for
'compress' => true,
change to
'compress' => false,

WordPress 2.5 RC1 Media Upload Problem Resolved

Software: WordPress 2.5RC1
Problem: Media Upload Problem
Status: Resolved!

As I was setting up this blog, I started out with WordPress 2.5 RC1 (Release Candidate 1). However, I faced a major issue with the new media uploading features that they have provided in 2.5; it failed to upload any media (I was trying audio). With some search, I stumbled on WP Support Forums and found that a few others were facing the same problem.

Finally, today, a working solution was posted. Thanks to Philip Barron for coming up with the solution here.

Solution: .htaccess tweak re mod_security and image upload using Windows Firefox