Posts Tagged wordpress
Fix “500 Internal Error” in Wordpress
I recently upgraded my Wordpress installation to the latest version (2.8.6) and started running into issues with uploading images. Every time I tried using the Flash Uploader I would see
HTTP Error.
On trying to use the non-flash browser based uploader, I saw the following:
Error 500 – Internal server error
An internal server error has occured!
Please try again later.
I googled quite a bit and finally found a solution. This error can happen because of quite a few different reasons:
- Incompatible plugins
- Incorrect .htaccess file contents
- PHP running out of memory
- Incorrect file permissions
- Not using PHP5
Incompatible plugins
Easiest way to find if this is the issue is to deactivate all plug-ins and see if the issue still persists. If it goes away you can activate each plug-in one by one to find the culprit. You can read more on managing plug-ins here.
Incorrect .htaccess file contents
For some people, the issue went away after fixing the .htaccess file contents. You need to ensure that the .htaccess file at root of your website has the following contents:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
You can read more about it here.
PHP running out of Memory
This can happen if you are using some memory hungry plug-ins. You can fix this issue by adding a php.ini file in <wordpresss_root>/wp-admin folder with the following contents:
memory=20MB
You can read more about this at codedifferent.com, where this is explained in more details.
Incorrect file permissions
Wordpress can start acting up if the permissions on directories and files in Wordpress installation aren’t set up properly. You can ensure that this is fixed by logging into your hosting provider and making sure all files and directories have permissions set to 755.
Another issue that might lead to errors while uploading is certain security issues with files used for uploading. This can be fixed by using Image Upload HTTP Error Fix plug-in. Otherwise, you could edit .htaccess to add the following lines:
#BEGIN Image Upload HTTP Error Fix <IfModule mod_security.c> <Files async-upload.php> SecFilterEngine Off SecFilterScanPOST Off </Files> </IfModule> <IfModule security_module> <Files async-upload.php> SecFilterEngine Off SecFilterScanPOST Off </Files> </IfModule> <IfModule security2_module> <Files async-upload.php> SecFilterEngine Off SecFilterScanPOST Off </Files> </IfModule> #END Image Upload HTTP Error Fix
Not using PHP5
Even after doing all the above, things weren’t working for me. That is when I came across this post, which explains that the issue could be because PHP5 wasn’t enabled. According to a help article on 1and1.com, fix is to just add the following line in .htaccess file:
#enable php5 AddType x-mapp-php5 .php
This fixed the issue for me!
Hope this helps.
Removing tags from Wordpress posts content
I have been using Wordpress since version 1.x and back then there was no native support for tags in Wordpress. Easiest thing to add tags to post was to use UTW or other plugins and because of my new found love for tags then, I started using WP-Tagerati and then moved on to Ultimate Tag Warrior. Using these plug-ins meant adding custom tags such as
<tags>foo, bar</tags>
or
[tags]foobar[/tags]
into each post. The plug-ins would parse the post for these custom tags and then tags could be displayed using some APIs provided by the plug-in.
Since v2.3, wordpress now comes with built in support for Tags. This has eliminated the need for using the above mentioned plugins. So, I decided to get rid of them. On disabling the plugins, I noticed that the custom tags along with the tagging information were appearing as post content. To fix this issue, I initially started using Embedded Tag Thing but finally decided to get rid of the tagging information from the posts altogether. Before you do get rid of the tags, do make sure that you import them into wordpress’s tag data, so that you don’t loose this information totally.
Considering that you have a standard installation of WP, fixing this problem is a breeze if you don’t mind playing a bit with phpMyAdmin. Just do the following:
0. Backup Wordpress
Backup you WP database. Always, backup your database before going in for direct manipulation of WP data. You can get a whole lot of information by reading about it here.
1. Download Posts table using phpMyAdmin
Go to the phpMyAdmin URL for you WP installation’s database. You can do this by using the very useful WP-phpMyAdmin plugin. As shown in the following screenshot, select the wordpress database that you have configured from the dropdown menu. And then select the wp_posts table. This will refresh the frame on the right side to display the wp_posts table.
Now, we are going to export the posts table. To do this, select the Export tab –> check the Add DROP TABLE checkbox –> hit Go. See the screenshot below.
This will take you to a page that contains a textbox with an SQL script in it. Copy the contents of the textbox and save them in a file.
2. Edit the file
Open the file in your favorite editor. You will see the SQL Dump that contains a lot of queries. Now, run a regex replace query on the content using the regex
\[tags\].+?\[/tags\]
This should go though you posts and remove all strings of the type [tags]foobar[/tags]. Change the regex to suit the way you have declared tags in your posts.
3. Import the file contents into wp_posts table
Go to phpMyAdmin and click on the import tab. See the screenshot for reference. Browse to the path where the modified file is located and just hit Go.
This should upload the file contents and execute the SQL queries in the file. If it fails and you see an error complaining about SQL_MODE being set to NO_AUTO_VALUE_ON_ZERO, just add a “--” in front of the statement
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
to comment it out and then try to upload the file again. If things work out fine, you will see a message that says something like “X queries were successfully executed“.
There you go, you are done, If you check the posts contents now, you will not see the tags information. And no need to use any plugins to explicitly manage these tags anymore. Though I do suggest using Simple Tags to gain more control over your tag management.
HemingwayEx 1.5 Final
I finally got myself to fix some more bugs and add a couple of new things into the HemingwayEx Wordpress theme. I received a few suggestions on features that could be added and after thinking about it a bit, I add some more things to this theme. This will (99.99%) be the last update of this theme coming out on my website. I have been intermittently updating this theme over the last year & a half and now I feel it’s time to move onto something else.
This update includes the following changes:
- A new CSS with Black, Blue and Gray colors.
- Added support for Paginating the homepage
- Added WP Gravatar API into the comments. You can turn it on/off using WP->Settings->Discussion page.
- Updated the theme to start using js included in WP itself.
- Removed support for Hemingway blocks. Now, this theme only works with Widgets.
- Fixed a few bugs reported by Thomas regarding the search page.
To get the theme go on over to the HemingwayEx download page.
It’s been a lot of fun working on this theme and I thank everyone who has used this theme and written to me about it.
Long long time ago…
Man…. it’s been ages since I have had a look at my site. I have been just too busy with work and lazy the rest of the time. My last post was on July 29th…
Finally, I upgraded to WP 2.3.1 tonight. As you can see (or might see), I am using the default WP theme right now as HemingwayEx doesn’t work with this version. I have been getting a lot of emails from people regarding this theme and many ppl have been enthu enough to go ahead and fix the theme to work with 2.3 as well. Hopefully, I will find sometime this weekend and do some work on it and answer questions in the forum.
Currently, I am eagerly looking forward to Dec and Jan. Both are going to be very eventful months. I am leaving for a three week trip to India in December and have other things coming up in Jan. Other than that, life is going on as usual… busy as hell on weekdays and boring/sad on weekends…
peace…
HemingwayEx 0.95 beta
Posted by Nalin in Miscellaneous on March 4th, 2007
I have updated HemingwayEx wordpress theme by adding some simple new features. I also made some bug fixes. The best thing about this update is that now users will see a notification of a new version on the HemingwayEx Option page. I really hope that this works. I am not much of a PHP coder… just hacked up what I could by reading Peter Harkins’s code for the wordpress plug-in Sociable.
I also fixed some more CSS issues with the white.css stylesheet. The worst part about styling a theme is making it compatible with different browsers. I must make my displeasure with IE’s handling of CSS very clear here. I have done what I can for now and will keep fixing things as I learn more.
You can download the latest version, 0.95 beta from HemingwayEx homepage.
If you are UPGRADING, you will need to reset/uninstall the previous version of HemingwayEx first as I have moved the blocks around. If you don’t you might find the display mixed up. Here are the steps you should follow:
- Goto HemingwayEx Options page and note down you settings.
- Now upload the new files for HemingwayEx theme.
- Click reset button right at the bottom of the HemingwayEx options page.
- Refresh the HemingwayEx Options page and set the options to what they were before.
Introducing HemingwayEx for Wordpress
Posted by Nalin in Applications, WWW on February 18th, 2007
Finally, after quite a bit of tinkering with the Hemingway theme, I have come up with HemingwayEx, an extension of the Hemingway wordpress theme. It’s sort of a beta release as I have only tested it with Wordpress 2.1 Ella and CSS support is mainly for Firefox. I have added quite a few new features, which makes it very different from other themes built on top of Hemingway, but it still preserves the essence of the original Hemingway theme.
I would love to hear from WP bloggers who give this theme a try. You can learn more about HemingwayEx here.
Installed Limit Post plugin
Posted by Nalin in Applications, WWW on April 17th, 2006
Up until now all the content of a post was being displayed on the index page. I didn’t like it that way and wanted each post to display only a certain number of characters and then have a link to the whole post. There is way to make it work when you use wordpress to create the posts, but I usually don’t do that. Even this post is being made using Blogjet. So I googled and found this plugin which does exactly that…
The only issue is that it’s not been implemented correctly. After certain posts that are truncated with certain HTML tags open, the rest of the document looses it’s formatting, usually getting italicised. I fixed the issue (partly) by editing the plugin. I changed line 40 from echo "'>".$more_link_text."</a></p>";
to echo "'>".$more_link_text."</a></em></strong></p>";
This ensure that the open tags for making the text italic and/or bold get closed for sure. It’s a very dirty hack, but has worked for me so far. Also, if you need your site to be valid for XHTML at all times, this is surely not the hack or even the plugin for you.



Azureus – Java BitTorrent Client
Get Firefox
Add to Google
Add to My Yahoo!
Recent Comments