Sunday 24 July 2016

Fix 500 Internal Server Error in WordPress

500 Internal Server Error is not specific to wordpress. Usually beginners who are managing site gets panic while getting this error. There are many causes for this type of error. Most of the time you will see this error in your own browser itself. Common ways of displaying error message.
  • “500 Internal Server Error”
  • “HTTP 500 – Internal Server Error”
  • “Internal Server Error”
  • “HTTP 500 Internal Error”
It says ‘something went wrong’, but the server is not clear about the error. This is a server side issue which tells that some configuration settings has changed. So if you are a website administrator you need to check on the configuration files, .htaccess files. PHP settings, log files.

Solution

Check .htaccess file.

If you are using .htaccess file then double check that file. The 500 internal server error may occur if the .htaccess file is corrupted. When you install wordpress and if you wish to edit the .htaccess file, then rename the original  .htaccess file to some .htaccess_backup. Create a new copy of the file and do your changes. In case if your .htaccess file gets corrupted you can replace the old file and check if the error is still there.
In my case I found that W3TC Browser Cache has inserted few lines into my  .htaccess file. I removed it and it works fine as before.
Keep in mind that there might be cases where you have multiple .htaccess file. So if you replace/remove one in your sub folder then the other file in your parent folder will cause problems.

You will get a long list of HTTP status codes from here.

Mime type for ipa and plist - iOS


Mime type for ipa - application/octet-stream
Mime type for plist- application/plist

Issue

Cannot download manifest file (.plist) from server. But the file still exists.

Analysis

Configure to allow the .plist file to be accessed by URL.

Solution.

Add above MIME types in the MIME type section in Internet Information Services (IIS) Manager and try again.


 

Friday 13 June 2014

Difference between @Html.TextBox, @Html.TextBoxFor & @Html.EditorFor

These are html helpers, which renders html input tag in which the type attribute is set to text.

@Html.TextBox("example")
 
This is the basic format of html helper for textbox. The html
 
 

@Html.TextBoxFor("example")

@Html.EditorFor("example")

Saturday 7 June 2014

Debugger not activated - Firebug

  • Open the Firebug window.
  • Click on the Firebug icon in the upper-left corner of the window and go to the menu item:
       Options > Reset All Firebug Options
  • Activate Firebug.

Friday 6 June 2014

The database '*\DATABASE1.MDF' cannot be opened because it is version 706. This server supports version 655 and earlier. A downgrade path is not supported. Could not open new database '*\DATABASE1.MDF'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

  • Version 706 is a database file from Sql Server 2012
  • Version 665 is a database file from Sql Server 2008R2



Tortoise workbench ignore certain files with hgignore

There may be cases where we want to ignore certain files before committing in mercurial distributed revision control system. We can ignore files using hgignore file.

  • hgignore file resides in the root folder.
  • Open the file
    • Right - click on file and open (CTRL + SHIFT + T). OR
    •  Take terminal from Repository tab and type 
      • thg hgignore
  •  If opened from the terminal

 
hgignore window


  •  Add file path or file extensions and add in the file.
  • It will take into effect after first commit.
  • After adding the restriction rules you can add hgignore file using
    • hg add .hgignore

Wednesday 19 March 2014

Logging Tools Log4Net vs ELMAH

Both needs configuration files.

Log4Net

  • Simple general purpose logging tool.
  • Easy to integrate.
  • Creates text file.
  • Log levels: DEBUG, INFO, WARN, ERROR, FATAL.

Pros
  1. Highly configurable logging framework.
  2. Best used by calling explicitly through code.
  3. Can implement exception handling with handlers.
  4. Output: file, console, email.
  5. Thread-safe.
  6. Will not throw unexpected exceptions at run-time potentially causing application to crash.
Cons
  1. Not reliable.

ELMAH (Error Logging Modules And Handlers)

  • Logging and notification of unhandled exceptions.
  • Since it handles all unhandled exceptions, log level is always ERROR.
  • Ability to display a  list of errors and the details of a specific error from a web page.
  • View exceptions via different mechanisms (SQL, RSS, Twitter, files, email etc).
  • Customize filtering logic.
  • Custom HandleError with ELMAH Attribute in ASP.NET MVC

Pros
  1. Good for reporting overall errors and unhandled exceptions.
  2. No change in application code for implementing ELMAH.
  3. Few configuration change.
  4. Good solution for YSOD (Yellow Screen Of Death).

Cons
  1. Can go complex.
  2. Only used for exception messages.


Log4Net - ELMAH - Appender
  • Communicate with ELMAH library on behalf of Log4Net.
  • Adds the ability to make Log4Net entries routed to ELMAH