500 internal server error PHP

There are several ways to occur 500 Internal server Error. Sometimes we can not assess why does it comes? Then First need is to check Error Logs from the server.
Log locations in your server:

Access Logs: /usr/local/cpanel/logs/access_log
Error Logs: /usr/local/cpanel/logs/error_log

The most common way to occur Internal Server Error by,

htaccess File
If you are using htaccess file, check that there is any rewrite rule affects with your URL. If you suspect any rule may affect, just comment it temporary and then check.
Because most of the rewrite rule written using <b>Regular Expression</b>.

MySQL injection
Sometimes when you Insert or Update DB data through AJAX or Form post it cause Internal Server Error. It means the posting data may contain any Query inside the data implicitly.

For instance - User posting the following data
Mr.Rag is going to select as this comittee member. This announcement will be telecast from Friday to Sunday. Bla Bla..

From example, Server Firewall captures MySQL keywords(select and from) that considers them as MySQL injection and return 500 Internal Server Error.

Note: Sometimes Changing POST method to GET method will get rid off Internal Server Error.

PHP Internal Server Error Htaccess Posted on 2016-05-26 08:00:24