Resolving WordPress Plugin Activation Error “Characters of Unexpected Output During Activation” & “Headers Already Sent” Php Error

 “The plugin generated 3 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.” – WordPress Error

Not good, right? This was the error message I ran into updating a WordPress plugin that I happen to really like. Worse, it indeed generated the “Warning: Cannot modify header information – headers already sent by…” error message when my caching plugin was active. While things worked without my cache plugin, my cache plugin definitely took priority over the lightweight image box plugin that was throwing the errors.

I did the obligatory searching for blank spaces at the beginning and ending of implicated php files for the “headers already sent” error to no avail. A little more research led me to a quick solution, though.

Resolving the Unexpected Output During Activation Error

It appears this happens because straight UTF has a few invisible bytes in the encoding that identifies it as UTF, known as BOM. This confuses PHP. (Like my technical talk here? Har!) But it’s easy to fix.

Grab the free Notepad ++, open the offending php file from the plugin folder–identified via your error messages–and using the “Encoding” option on the Notepad ++ menu, change the encoding from UTF-8 to Encode in UTF-8 (without BOM). Save and replace it in the plugin folder. Woot!

Hope this helps somebody!

Share Button

Widows Live Writer Error “Invalid response document returned from XmlRpc server” After WordPress Update Fix

My solution for the Windows Live Writer (WLW) error:

The response to the metaWeblog.newPost method received from the blog server was invalid:  Invalid response document returned from XmlRpc server

Warning: This solution entails editing a WordPress core file and is therefore generally not recommended. If some PHP guru knows how to fix this with code in the functions.php file or something, I’m all ears!

  1. Find class-wp-xmlrpc-server.php in wp-includes folder
  2. In the code, locate the line “if ( strpos( $post_content, $file->guid ) !== false )”
  3. Directly before it add another line of code…
if($file->guid && !($file->guid == NULL))

I’m usually not big on editing core files, but I use WLW to blog daily and this error keeps cropping up. It’s highly frustrating and there are numerous fixes around the web that are both more time consuming and not necessarily effective. This is a quick, down-and-dirty fix that will get you up and running.

Solution Courtesy “Stuff I Stumbled Upon Blog

Share Button

Creating Addon Domain for Site Hosted Elsewhere in cPanel

Trying to set up a site as an addon domain before moving it from another hosting account? You may get mooned by cPanel in such cases. Here is there error you see and (more importantly) how to fix it.

When you try to set up the addon, you get this message:

There was a problem creating the addondomain. Show Details

Error from park wrapper: Using nameservers with the following IPs: xx.xxx.xxx.xxx,xx.xxx.xxx.xxx Sorry, the domain is already pointed to an IP address that does not appear to use DNS servers associated with this server. Please transfer the domain to this servers nameservers or have your administrator add one of its nameservers to /etc/ips.remotedns and make the proper A entries on that remote nameserver.

In order to eliminate this error, go into WHM. In Server Configuration, under Tweak Settings option, check this box:

Allow Creation of Parked/Addon Domains that resolve to other servers (i.e. domain transfers) [This can be a major security problem. If you must have it enabled, be sure to not allow users to park common internet domains.]

Once you’ve created the addon domain, you can untick this box again. It’s more secure to leave it unchecked, of course, but many times you’ll want to get the new site up and running before you change over DNS, huh? At least, if you’re smart, you do.
photo credit: bwright923

Share Button

Changing Directory Ownership via Command Line

Trying to replace, delete or change files via FTP, you may notice you get insufficient permissions errors. If you haven’t seen this a lot, your first instinct is to try to change the permissions on the directories in question, in which case you will continue to get mooned. This issue is less about permissions per se than about directory ownership. If you’re running on a server that has some directories owned by nobody/99, that means the server itself is considered “owner” and individual users won’t be able to change or delete these. ((If your server requires 777 permissions for certain functions, then you most likely will have some directories “owned” by the server/nobody.))

chown -Rv username:groupname *

The username/groupname should be replaced with your info–but you don’t know this already, best to get out of there and get tech support to help you–and these two will normally be the same. The R makes it recursive, changing the files inside the directory as well as the directory you run the command on, and the v gives you verbose output so you can see what got changed.

Share Button

Manually Adding an Admin User to a WP Database

Lost your admin password? Need in to the WP admin but client hasn’t given you access? If you can access the database directly–easiest using a tool like PHPmyAdmin–you can give yourself whatever access you need.  ((Big hugs and kisses out to DNA Web Agency for this uber-helpful information lifted for this tutorial.))

Locate the right database–if you have FTP, looking at the wp-config.php file at the root of your WP installation is the fastest route. Otherwise, if you have multiple WP installs, check out the options table to match urls and make sure you’re looking in the right database.

In your wp_users table, you insert a new record:

  1. user_login –username to access WordPress
  2. user_pass – password – be certain to select MD5 from the phpMyAdmin Function dropdown menu; it’s stored encrypted)
  3. user_nicename – how you’d like to refer to yourself, not login
  4. user_email – email for this user
  5. user_url – optional
  6. user_registered –  just select a date
  7. user_activation_key – leave this blank
  8. user_status – leave this set to 0
  9. display_name – what displays, can be same as nicename

Note the user ID, as you’ll need it for the next steps.

To give yourself access permissions, head on over to insert a record into the wp_usersmeta table.

  1. umeta_id – automatically generated
  2. user_id – ID of the user you just created
  3. meta_key –  wp_capabilities
  4. meta_value copy and paste this:

[code]a:1:{s:13:”administrator”;b:1;}[/code]

Insert another row, with this information:

  1. umeta_id – automatically generated
  2. user_id – use the ID you created
  3. meta_key – insert wp_user_level
  4. meta_value – insert 10

Save your work and go log in!

Share Button

Disabling WordPress Plugins When You Cannot Access Admin Area

When you cannot access the admin of a WordPress installation because of a plugin issue, you can delete the plugins directly from a database management tool like PHPmyAdmin. (And if you can’t access the WP backend, there’s a good chance it is because of a plugin issue.)

This helpful tidbit comes from the WP FAQ

  • In the table wp_options, under the option_name column (field) find the active_plugins row
  • Change the option_value field to: a:0:{}

If you have FTP access, you can also rename your original plugin folder (/wp-contents/plugins) and and add an empty plugin folder. After you sign on to your WP admin area, you can delete the dummy folder and rename the plugin folder back to “plugins,” as it will have deactivated all  your plugins when you signed on with the empty folder.

Happy WordPressing!

Share Button

Default New Account Address of Server IP/~username Not Working?

If you cannot access your sites via http://ipaddress/~username (usually used as a temporary address pending domain propagation for new hosting clients), check that the Apache module mod_userdir, if enabled, has an exception configured for the default virtual host.

End transmission.

Share Button

Solving FTP Deletion Error “550 Prohibited file name”

Trying to delete a file via FTP and unable to? Getting a “550 Prohibited file name” error? Annoying! But also very easy to fix. Create a php file called “unlink.php” with this code, replacing the “YOUR-FILENAME-HERE” with–what else?–your undeleteable file name.

<?php unlink('YOUR-FILENAME-HERE');?>

Upload it to the directory with the file in question, and visit the script in your web browser. It will remove the previously unruly file. ((Thanks to irasmith’s forum post for this solution.))

PHP noobs, please remember to have NO blank spaces before or after the beginning of your code in PHP files, or you’re liable to get a “Cannot modify header information/Headers already sent” error. You can create the file in a text program and simply rename it with a .php extension.

Share Button