[Drupal] How to troubleshoot 500 Internal Server Error?
BY deepa.n
3 years ago
comments comment

Occasionally we might come across 500 Internal Server Errors on our website. Are you getting the same error? If yes, let us find out how to fix this issue. Internal Server Error messages indicate a server-side error and there is something wrong with the server configuration. However, ensure that whether the problem still exists, by trying the following methods. Because this can be a temporary issue, may be due to browser cache or cookies.

  • Reload the web page. You can try:
    • Clicking the 'Reload this page' icon in the browser
    • Pressing F5 key on the keyboard
    • Enter the URL on the browser's address bar and load the page again.
  • Clear your browser's cache.
  • Delete your browser's cookies.
  • Restart your browser

There are lots of reasons behind a 500 Error. However the most common causes are:

  • Permissions Errors: An incorrect permission on one or more files or folders.
  • PHP Timeout Issues: If your script connects to external resources timeout.
  • A missing or erroneous .htaccess file

Here is the complete error message for reference:

internal server .png

How to fix 500 Internal Server Error on your site?
Let us find out the actual reason behind the internal server error in the server error log first. Follow the below steps:


  • Login to your cPanel account.
  • Click on the 'Error Log' icon under 'Logs' in the cPanel home page.
  • Go through the errors logged.

From the error messages, we can identify whether internal server error occurred due to an incorrect permission or a PHP Timeout or the 500 server error caused due to missing/erroneous .htaccess file.



on 19th December 2008 / by webmaster
We had a query from one of our customers to help them migrate their local mail server to Google Apps. They wanted to do this because they did not have the sufficient in-house capability nor have the funds to get paid external capability to support an internal mail server. One hurdle that they were facing was that they had around 40GB of mail left on the local mail server that they wanted to migrate to the new mail accounts they created on Google Apps. One of the problems was that the local IMAP server kept on crashing whenever they tried the bulk import and then there were frequent authentication errors. We took up the project and completed the migration process within a week. The migration took that long because the complete 40GB(not quite because Google rejects huge attachments) had to be uploaded to Google over an unfavorably biased upstream channel. The local mail server was dovecot and it was a pretty old version of dovecot too - pre 1.0. The IMAP server used to crash erratically during the bulk migration process but we worked around this by running a small script to restart the IMAP server if it went down after checking every minute. One good thing about the migration process with Google was that the bot was very patient and would retry on accounts that fail. So this 1 min interval ensured that the mail in the accounts from which import was happening at the time of crash always reached the Google server once the IMAP came back on. Another problem was that there were quite a lot of authentication failures. It seemed that the mailserver was restored from a backup after some recent crash and this messed up the users and their uids leaving lot of mboxes orphans without valid users associated. Since the mboxes were named username we simply ran a script to move ownership back to the user with the same name. To add to the mess the local server was already compromised and was running a full scale spam relay service. We did not fix this issue as the server was going to be put to sleep after the migration. We worked around this issue by stopping all the unnecessary processes on the server other than the IMAP server. Once the initial hiccups were sorted out the migration went smoothly and Google neatly imported the complete set of accounts and their mails from the local server. Google recognized the IMAP folders and labeled the emails accordingly while being imported into Google Apps. Other than the small concern that Google is going to have complete access to all your organizations mails there are no other reason that I could think off that should prevent small educational institutions in moving to Google Apps. Google Apps offers free services for educational institutions. For commercial establishments a lite edition is free for use but the full and heavier version requires you to pay Google subscription charges. If you are a small user it might be better for you to avail the Free Services from Google and as you grow you can decide between the Free vs Paid services from Google or alternatively start looking at getting support externally initially and the finally hiring internal capability to manage your local servers. Our Server Support Services and Migration Services We however are happy to offer to any interested customers our services in remote administration of existing servers, i.e. if you are planning to get external help or if you are finding that paying for internal capability for the same is not entirely worth the money. For those who are looking to migrate to Google Apps, you can avail our services to have a hassle-free migration experience. System Administration Internet GNU Linux Server Administration Leave a reply Your email address will not be published. Required fields are marker *

on 11th May 2012 / by vimal
Are you looking to configure Drupal with nginx Server? Here is how you build nginx from source with php upload progress module in ubuntu. Create a directory nginx-src and change to that directory mkdir nginx-src cd nginx-src Then download the source package via apt apt-get source nginx-full If everything went successful, you get the nginx directory. inside the nginx directory, you have to modify the rules file in the directory debian in the debian/rules file add the configuration option --add-module=$(MODULESDIR)/nginx-upload-progress to the session config.status.full (Note: The source package with ubuntu already includes the nginx-upload-progress module in the debian/modules directory, so you do not have to download the module separately) Before compiling the package, we need to make sure every dependency libraries are available for compiling nginx with the command sudo apt-get build-dep nginx-full (In ubuntu I found that the dependency on libgd2-noxpm-dev conflicts with php5-gd package. So if you want to keep php5-gd with nginx you have to edit the debian/control file and change the dependency on libgd2-noxpm-dev to libgd2-xpm-dev) After setting up all the dependencies, execute the command dpkg-buildpackage -rfakeroot -uc -b to build the debs required. The deb files will be created in the nginx-src directory. You can then install the package with the command sudo dpkg -i nginx-full_1.0.5-1_i386.deb You can verify whether the upload-progress library is enabled with the command sudo nginx -V System Administration Ubuntu Web Development Server Administration nginx Leave a reply Your email address will not be published. Required fields are marker * Lucas Saliés Brum (not verified) access_time 23 May 2019 - 13:02 Thank you!!! Awesome tutorial! augusto (not verified) access_time 23 May 2019 - 13:02 on my brand new vps, had a root@li205-109:/opt/nginx-src# sudo dpkg -i nginx-full_1.2.1-2.2_i386.deb (Reading database ... 31565 files and directories currently installed.) Preparing to replace nginx-full 1.2.1-2.2 (using nginx-full_1.2.1-2.2_i386.deb) ... Unpacking replacement nginx-full ... dpkg: dependency problems prevent configuration of nginx-full: nginx-full depends on nginx-common (= 1.2.1-2.2); however: Package nginx-common is not installed. dpkg: error processing nginx-full (--install): dependency problems - leaving unconfigured Errors were encountered while processing: nginx-full while installing the packaging with sudo dpkg -i nginx-full_1.0.5-1_i386.deb Solved with a sudo apt-get install nginx-common Add new comment

on 01st June 2012 / by sujith.s
When a server is managed by more than one admin, it’s always a challenge to keep track of the changes made to the configuration. And when in a multiserver environment managed by more than one admin, this is going to be more complex. It would have been much saner if there was a utility to handle all this. The ones that we found were quite complicated and was made for handling huge numbers. All we wanted was a very simple utility to do just the job, without much bells and whistles. And so, we started out on our own. Here’s what we have now. We were using the Git for our Drupal code base version controlling. We thought the same could be made use of for system configuration file versioning. We created a bash script that did just that and scheduled it to execute once every hour. The script compares configuration files with the ones we have in the git repo, and if changes are found, it copies them to a directory called conf and adds the changes to git. It reads the details of files to be tracked from a configuration file kept for the same. Cron was used for scheduling jobs. The script can run both as root as well as any normal user. If the script finds any difference it sends out an email to the recipient address stored in the script. The script requires that you have a git server and that you have already created a repo for the same. Here is the script (you might have to modify the email, hostname variables):. You can also follow this at https://github.com/anoopjohn/utils/tree/master/chkconfig #!/bin/bash DEBUG=0 LOG_FILE="log.txt" email_to_address="email1@example.com" email_cc_address="email2@example.com" # Debug function function db { if [ $DEBUG -eq 1 ]; then echo "$1" fi } # Log function function log { # If there are parameters read from parameters if [ $# -gt 0 ]; then echo "[$(date +"%D %T")] $@" >> $LOG_FILE db "$@" else # If there are no parameters read from stdin while read data do echo "[$(date +"%D %T")] $data" >> $LOG_FILE db "$data" done fi } # Change to the dir this script resides in script_path=`readlink -f $0` script_dir=`dirname "$script_path"` cd "$script_dir" # Run copy operations if run as root if [ $(id -u) -eq 0 ]; then db "Running copy operations" # Copy files to the conf folder while read path do # Ignore comments and empty lines echo "$path" | egrep '(^\s*#)|(^\s*$)' >/dev/null 2>&1 && continue db "$path read from the file" source="$path" destination="./conf/`hostname`$path" if [ -f "$source" ]; then # If file then copy param='-f' elif [ -d $source ]; then # If folder then deep copy param='-fR' destination="`dirname \"$destination\"`" # Create the destination folder if it does not exist if [ ! -d "$destination" ]; then log "$destination does not exist. Creating dir" mkdir -p "$destination" fi else log "$path: Illegal path found." # Continue on to the next path continue fi db "Copying $source to $destination" (nice cp $param "$source" "$destination" 2>&1) | log done < ./`hostname`.conf db "Changing ownership of conf/`hostname` to metheuser" chown -R metheuser: metheuser "conf/`hostname`" # Run git operations if run as normaluser else db "Running git operations" # Run git diff to find changes file_diff=`git diff --no-prefix` diff_lines=$(($(echo -n "$file_diff" | wc -l))) # Run git status to check if untracked files are present git status|grep untracked > /dev/null if [ $? -eq 0 ]; then has_untracked=1 git_status=`git status` fi # If there is a difference if [[ $diff_lines -gt 0 || $has_untracked -eq 1 ]]; then log "$diff_lines line(s) of difference found" log "Has untracked = $has_untracked" # Get latest changes from other servers log "Pulling changes (if any) from server" (git pull 2>&1) | log # Commit the difference on the machine (git add -A 2>&1) | log (git commit -m "Adding changes from $(hostname)" 2>&1) | log (git push 2>&1) | log db $file_diff subject="[CONFIG-TRACK] `hostname` - Status Report - $(date)" git_differences="`echo -e "$file_diff\n$git_status"`" log "Sending differences via email" log "$git_differences" echo -e "$git_differences" | mail -s "$subject" -c $email_cc_address $email_to_address 2>&1 | log else db "No differences found" fi fi Linux System Administration Server Administration Git Version Control System Leave a reply Your email address will not be published. Required fields are marker * Anonymous (not verified) access_time 23 May 2019 - 13:02 Thanks it is exactly what I'm looking for. Add new comment
Leave a reply
Your email address will not be published. Required fields are marker *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.