500 Internal Server Error

Understanding the 500 Internal Server Error

What causes it? How to fix it Perl Errors

The 500 Internal Server Error can be very frustrating because it is such a vague error. In addition to the error message text itself being vague, there are actually several different issues that can cause the 500 error message to appear. This can lead to headaches for troubleshooters.

What causes 500 Internal Server Errors?

Here are the three most common reasons:

    1. Incorrect file permissions – Most commonly having a file as “world” writeable. This is a very common issue with PHP files. In general on our servers, PHP file permissions should not be higher than 775. Keep in mind too that the permissions of the parent folders/directories need to be set correctly too. See our File Permissions article for more information, including how to change those permissions.
    2. Leaving file permissions set incorrectly after manual installation of content management systems, forums, blogs, etc.
    3. Coding errors in the .htaccess file.

Correcting a 500 Server Error:

To track down what is causing the error, you will want to start with the error log in cPanel. Once you are logged into your cPanel look for and click on the “Error Log” icon under “Logs.”

cPanel-error-log

For example, if I set a PHP file to 777 permissions (writeable by the world) this will cause a 500 Internal Server Error. I would be able to view something similar to the following in my Error Log:

[Tue Sep 20 08:18:01 2011] [error] [client 174.77.92.170] SoftException in Application.cpp:264: File "/home/username/public_html/concrete/index.php" is writeable by others

I would correct this by changing the permissions of the index.php file to 644.

Perl Scripts and 500 Errors

While a 500 error from a Perl script error may not be common, it can be even harder to track down because the cPanel Error Log does not tell us in this case what specifically caused the 500 error message. You will want to track down the code causing the error. It can even be something as simple as one missing character in your code. For instance, in the following code:

#!/usr/bin/perl
print "content-type: text/html nn"
print "Hello, PERL!";

The second line is missing a semi-colon at the end, so:

print "content-type: text/html nn"

SHOULD BE…

print "content-type: text/html nn";

There are many different possible causes of 500 errors, so it is difficult to give an example of each and every situation. If you’ve looked for the above causes but are unsure on what needs to be done next to fix the problem, please contact technical support. We’re available 24/7 and we’re always happy to help.

JB
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

119 Comments

  • After Uploading the new WordPress website to the server

    It’s Shows

    Error 500 – Internal Server Error
    An error was encountered while processing your request. Typically this is a temporary condition. Please contact the web site owner for further assistance.

    Physical Memory Usage
    971.57 MB / 1 GB (94.88%)

    Entry Processes
    13 / 20 (65%)

    [Thu May 27 02:23:17.903383 2021] [core:alert] [pid 439783:tid 47349356418816] [client 37.245.254.46:15703] /home/stdalfourdubai/public_html/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
    [Thu May 27 02:23:13.370733 2021] [core:alert] [pid 960083:tid 47349375330048] [client 37.245.254.46:16072] /home/stdalfourdubai/public_html/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration, referer: https://stdalfourdubai.com/wp-admin/

  • Hey,
    Am getting Error 500 – Internal Server Error

    An error was encountered while processing your request. Typically this is a temporary condition. Please contact the web site owner for further assistan
    inside the error file it reads:

    [Fri Sep 13 01:18:41.864398 2019] [core:crit] [pid 164653:tid 47199304476416] (13)Permission denied: [client 185.86.164.108:59270] AH00529: /home/primem11/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/home/primem11/public_html/’ is executable

    kindly assist

  • Error 500 – Internal Server ErrorError 500 – Internal Server ErrorAn error was encountered while processing your request. Typically this is a temporary condition. Please contact the web site owner for further assistance.

    • We are happy to help however, it’s unclear from your comment, how we can assist you. Can you please clarify how we can help?

  • Hi I have a 500 error. I tried renaming the .htaccess, rename plugins directory and check permissions and I can’t seem to shake this error. I checked the error file and I received this:Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite3.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20060613/sqlite3.so: cannot open shared object file: No such file or directory in Unknown on line 0

    [10-Oct-2017 04:29:48 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20060613/tokenizer.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20060613/tokenizer.so: cannot open shared object file: No such file or directory in Unknown on line 0

    [10-Oct-2017 04:29:48 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20060613/xml.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20060613/xml.so: cannot open shared object file: No such file or directory in Unknown on line 0

    [10-Oct-2017 04:29:48 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20060613/wddx.so

    • Run this command from the command line:

      grep ^extension /usr/local/lib/php.ini

      If you have an empty “extension =” line, then it will produce these errors. Comment out that line, then see if the errors cease occurring.

  • I updated some of the plug-ins on my website yesterday and now I can not access the Admin dashboard and I receive the http error 500 message. 

    Please Advise.

    Thanks

    • Rename the plugins folder in /wp-content/plugins this will break the plugins but should allow you access to the backend of WordPress.

  • Running latest WordPress with Photocrati theme. Installed WordFence and ran a successful scan. Didn’t get to the Firewall configuration.

    Wanted to also add W3 Total Cache but before I could get the name added to the search block, the site gave me the dreaded 500 – Internal Server Error.

    Now I can’t even access the site login page – but I can access AMP and panel. No messages in the error log when I check Errors in the Metrics menu of Cpanel.

    I suspect the problem can be fixed … but not without some assistance.

    • Try renaming the htaccess file. If the site appears after that, then the error is in that file. You may want to contact your specific live Support team for specific account assistance, however.

  • Hello,

    My site has been showing an internal server error,  but there are no errors in my error log. web page is www.*******.pe and yes its hosted by inmotion,  I changed the defines.inc file to display the error and this is what i get: I only get this error on the home page every other inner page works correctly

    [PrestaShopException]

    Invalid product vars
    at line 106 in file classes/Link.php

    101.             if (is_array($product) && isset($product['id_product'])) {
    102.                 $product = new Product($product['id_product'], false, $id_lang, $id_shop);
    103.             } elseif ((int)$product) {
    104.                 $product = new Product((int)$product, false, $id_lang, $id_shop);
    105.             } else {
    106.                 throw new PrestaShopException('Invalid product vars');
    107.             }
    108.         }
    109. 
    110.         // Set available keywords
    111.         $params = array();
    
    • Hello Daniel,

      Did you make any recent changes to the site? The error seems to be pointing to a product issue. Have you tried removing any recently added products? Give us a little more information considering the issue and we can look into it further.

      If you have any further questions, please let us know.

      Kindest regards,
      Arnel C.

  • Hi , I am a begginer, I trying to upload a theme and the boldgrid but the system notice a 500 internal error.

    I look for information and talk about rename .htaccess. 

    I do that but still  having the trouble

    Could you hep me?

    the domain is *******.com. I am a vps plan with you

  • Hello Everyone.

     

    I am getting 500 internal server error while configuring the payment method in admin panel.

    When i check my error log It giving me this following error :-

    Thu Jun 02 06:20:05.428998 2016] [access_compat:error] [pid 272585:tid 1397372349404832] [client 23.235.195.137:630631] AH01797: client denied by server configuration: /home/******9/public_html/mage2/app/etc/config.php

    Please help me out from this error.

  • Hello i am an inmotionhosting customer

    I have Error 500 issue and i can’t find anything in the Error logs in Cpanel it’s just Empty!

  • My subdomain is just blank after uploading the web folder and database. If I change the permission from 755 to 777 I get 

    Error 500 – Internal Server Error

    An error was encountered while processing your request. Typically this is a temporary condition. Please contact the web site owner for further assistance.

     

    I have no .htaccess file and I can’t figure out what is going on. I have been on this for over 10 hours.

    • Hello Royal,

      The folder containing the website files cannot be 777 or it will definitely get the 500 error. It should be 755 by default. We would need to see the domain name or account user name in order to troubleshoot (if you’re a customer of InMotion).

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  • Pls. help me my site homepage look like this.

    Warning: include(../../assets-php/session.php): failed to open stream: No such file or directory in /home4/patawad/public_html/index.php on line 2

    Warning: include(../../assets-php/session.php): failed to open stream: No such file or directory in /home4/patawad/public_html/index.php on line 2

    Warning: include(): Failed opening ‘../../assets-php/session.php’ for inclusion (include_path=’.:/opt/php54/lib/php’) in /home4/patawad/public_html/index.php on line 2

    Warning: include(../../assets-php/db_connection.php): failed to open stream: No such file or directory in /home4/patawad/public_html/index.php on line 3

    Warning: include(../../assets-php/db_connection.php): failed to open stream: No such file or directory in /home4/patawad/public_html/index.php on line 3

    Warning: include(): Failed opening ‘../../assets-php/db_connection.php’ for inclusion (include_path=’.:/opt/php54/lib/php’) in /home4/patawad/public_html/index.php on line 3

    Warning: include(../../assets-php/function.php): failed to open stream: No such file or directory in /home4/patawad/public_html/index.php on line 4

    Warning: include(../../assets-php/function.php): failed to open stream: No such file or directory in /home4/patawad/public_html/index.php on line 4

    Warning: include(): Failed opening ‘../../assets-php/function.php’ for inclusion (include_path=’.:/opt/php54/lib/php’) in /home4/patawad/public_html/index.php on line 4

    Warning: mysqli_query() expects parameter 1 to be mysqli, null given in /home4/patawad/public_html/index.php on line 6

    Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home4/patawad/public_html/index.php on line 8

     
  • I have been having the Error 500 which goes on and off like everytime i try to edit my website. Also giving my Error in Estaablishing Database.

    This has gone on for 2 days in counting now…. Any help please and its urgent

    • Hello Olasope Tubi,

      Sorry for the problem with the 500 error. We need a little more information if you wish for us to help troubleshoot the issue. If you are an InMotion Hosting customer, then please provide domain name and we can look at it closely. If you wish for the issue to be handled privately, then please contact our live technical support team via chat/phone/email. If you’re not a customer, then please provide a URL and any information on your site leading up to the error.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  • hey please i deleted some thing in my categories under my theme configuration now i am getting the 500 error and my admin page for my presta shop is showing me access denied 

    • Hello alexander,

      Thank you for contacting us. Did you try any of the above suggestions? Specifically, I recommend checking the permissions of the file, since you are getting an “access denied” error.

      If your problems persist, you may have to add what you deleted back to the theme, or restore your site from backup.

      Thank you,
      John-Paul

  • It wasn’t a permission issue, apparently it had something to do with a syntax error in an .ini file (which, I’m not even sure how it got to that directory to begin with). So, it was fixed by deleting the file.  Odd.

    • Hello Anna,

      I am glad everything worked out. Please let us know if you have further questions or issues as we are always more than happy to help.

      Best Regards,
      TJ Edens

  • Both of the automatic Joomla installs through Softaculous cause 500 errors (so Joomla 2.5 & 3.4.4). My assumption is that there’s a problem with the installer (maybe it doesn’t set proper permissions), I don’t want to trouble shoot it, is it something you will fix, or would I just have do my own from scratch install?

     

    Thanks.

  • I’m very new to web hosting etc and needed to transfer a clients website to my server. I was receiving this error and managed to sort everything out with changing permissions.

    Thank you!!!!

  • Just upgraded to a CC2000, it is down with a 500 Internal Server Error since this morning, unable to login to cpanel or SSH.

    How do i sort this out ?

  • I hosted wordpress website,I got error

    Error 500 – Internal Server Error

    [Mon Jun 29 04:51:31 2015] [alert] [client 125.99.159.166] /home/golars7/public_html/9thnetworks.com/.htaccess: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration

    • Hello munaf,

      That type of command will not run on our specific servers. You may want to set those commands in the php.ini file instead.
      Kindest Regards,
      Scott M

  • Hi i have OpenCart 2.0.1.1 and can not enter my Admin Panel.

    When i try i get this error:

    ERROR 500 – INTERNAL SERVER ERROR

     Can you help me please?

    Thank you in advance

    • Hello Big Joe,

      Thank you for contacting us. Have you tried any of the solutions in the article above?

      Thank you,
      John-Paul

  • hello i am getting the erro no 500 internal server erro when the file upload on my website will be start the erro is genereted. help me, i have hostet the website on windows hosting so how can i fix the erro on it.

    • Hello Hardik,

      We do not know much about Windows hosting as we have no Windows servers in our fleet. However, the .htaccess file (where the issue usually resides for 500 errors) has an equivalent file on Windows hosting called Web.config. You may want to start there and see if there is some type of configuration you need to change.

      Kindest Regards,
      Scott M

  • Hi!

    I am totally new at Prestashop (or creating any website whatsoever) and have little to no knowledge about PHP, scripts, etc.

    When confirming an order (with bankwire payment), customers see an error page. They receive no e-mail and the order is not registered as order in Prestashop. What to do to fix this problem?

    I asked the hosting company to check my error log and this is what they see:

    Premature end of script headers: php-cgi, referer: https://staalkaartje.nl/index.php?fc=module&module=bankwire&controller=payment File does not exist: /var/www/vhosts/29/182638/webspace/siteapps/Prestashop-248692/htdocs/error_docs, referer: https://staalkaartje.nl/index.php?fc=module&module=bankwire&controller=payment

    I hope someone can help me. Thanks in advance!

    Kim

    • Hello Kim,

      Sorry for the problem with the Bank wire module. In the future, it would help us (or any forum) if you could provide the version of PrestaShop that you are working with. It would also help to know the error pages that are being displayed and steps to duplicate the issue.

      The problem you’re seeing has been reported in the PrestaShop forum, and they have supposedly solved it. There are several posts, but check this one to see if it will resolve our specific problem: bankwire issue. Also, in regards to the email problem, this is most likely a separate issue. Make sure to check your Email settings under the Advanced parameters. Some hosts require that you provide SMTP settings. You will need to double-check with your hosts to confirm this issue. You can test the email option in that area, though.

      I hope this helps to answer your question, please let us know if you require any further assistance.

      Kindest regards,
      Arnel C.

  • Hi JeffMa
    I’m no expert.
    I could download PrestaShop and replace the file (Cart.php) with FTP.
    This solution might work?
    Or, there is a solution that I can deal with?
    Or is it better that I ask your technical help?
    best regards
    Davide R.

    • Hello Davide,

      The error message “syntax error, unexpected ‘{‘, expecting function (T_FUNCTION) in /home/aerree5/public_html/override/classes/Cart.php on line 143” gave me the general location of the error. They can sometimes be before the referenced line number, but in this case, it was literally on line 143 and there was an extra { on that line. Removing it seems to have fixed the site for you. It is now displaying in a proper maintenance mode.

      Kindest Regards,
      Scott M

  • Hi Arnel

    Thanks for the answer 🙂

    This is the error message:
    syntax error, unexpected ‘{‘, expecting function (T_FUNCTION) in /home/aerree5/public_html/override/classes/Cart.php on line 143


    Kindest regards,

    Davide R.

    • This does seen to be a code error on your site. Could you provide the line 143 as well as the surrounding lines in the file referenced in the error?

  • I would be very grateful if I helped them solve the following problem, given that the beginner:
    31/12 from the Control Panel I can not access it at will to CATALOGUE CATALOGUE / PRODUCTS
    Addressing the Explorer to my site shows “http 500 internal error
    I find in INFORMATION files were found missing / changed: config / defines.inc.php
    I find tutorials for modoficare with FTP config / defines.inc.php
    I run with these indications

    For PrestaShop v1.5.3 +
    1. Open config / defines.inc.php
    2. On or around line 28 you will find this line
    define (_ PS_MODE_DEV_‘, false);
    3. Change That line to read
    define (_ PS_MODE_DEV_‘, true);
    and another error appears.
    I restored the “false” and returns to appear the error http 500 internal error

    Given that I have installed
    Presta Shop 1.6.0.8
    All the CONTROL PANEL works.
    Thank You
    David

    I apologize for my / google translation

    • Hello Davide,

      Sorry for the problem you’re facing. Although you are getting a 500 internal error, this information is not enough to help us troubleshoot the issue. You will need to make sure that error reporting has been enabled. It sounds like you did it before, but you didn’t provide what the other error message said. Please re-enable it. and then please provide us the error message that you saw (the second error message). This will be more verbose and provide us the detail to determine what’s wrong.

      Please provide us the second error message (after enabling error reporting) and then we can troubleshoot the problem for you. If you have any further questions or comments, please let us know.

      Kindest regards,
      Arnel C.

  • I got 5oo error when I go any intenal link page such as login and other to change the site  contents and pages images

    • Hello Anoop,

      Did you check out the article above for cause and fixes? Unfortunately your question gives no information on your site, nor can I tell if you are one of our customers in case I could check your account. Start with the information above. Most of the time, the .htaccess file is at fault, so also take a close look at that file.

      Kindest Regards,
      Scott M

  • Hi, I was also getting a HTTP 500 error and fixed it by switching to the latest version of PHP.

    However, when I access my error log it doesn’t show anything!

    Where can I find the apache error log for my account?

    sanmiguelshowcase.com (main: coldwellbankersmart.com).

    Thanks!

    • Hello Victor,

      Access to Apache settings and reports on the server would require technical support team access to the server. You can obtain it by contacting our live technical support team through email, chat or phone. They are available 24/7. Apologies that you do not have access to that particular log.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  • Hello,

    Thanks! Now works well. It is disappointing, the theme installation guide specify this type of permissions. I will talk with the theme developer.

    Thanks again!

  • Hello,

     

    I have already install a theme in my Prestashop store (www.e-maginestore.com) but my sitecan’t load https://www.e-maginestore.com/modules/csslider/csslider-ajax.php, there is an 500 Internal Server Error. The permissions of the csslider are set in 777.

     

    How can I identify the error?

     

    Thanks!

    • The server will typically produce errors with 777 permissions because it is extremely insecure. Change the permissions to 755 and the issue should resolve.

  • hi,my english is very poor.after i install open cart on the server erorr  500 internal server happend .what to do now?please help me

    • Hello Maryam,

      There can be quite a few causes of this error type. If you have gone over the causes above and are still not quite sure what is going on, feel free to contact our Live Support team and they can take a look with you to see if they can locate the source of the issue.

      Kindest Regards,
      Scott M

  • i am getting the 500 internal server error every time i try to watch a YouTube video from either my firefox or chrome browser.  when i do the same from my Explorer browser, everything works fine.  I noticed each of the above situations (that i read, about 5 or so) were people getting this error regarding their own website – but this is not my website error, it is happening when watching youtube videos –  Also, same happens if i clik a link to a video from an email or something.  Also, if i am on another site that has a youtube video embedded, i get a diff. error that says ‘an error occured’, please retry – or something close to that.  Any ideas to get my browsers using youtube?  i WAS ABLE to view a WEBINAR on my Firefox browser – this was not using youtube…just someone elses web page.  Thank you for any help.

    • Hello Cindy,

      It sounds like you have an actual issue with your browser since its happening on different websites. Have you tried using Google Chrome? This is not normal behavior for firefox and may be a result of a virus on your computer.

      Kindest Regards,
      TJ Edens

  • I went ahead and tried the plugin thing. Deactivated them all, and the page and others that were giving me the 500 error, all loaded. I started activated the plugins 1 by 1, and here are the ones that when activated, gave me the error once again.

     

    NextGEN Gallery by Photocrati 
    Version 2.0.66.29

    WP Facebook Open Graph protocol
    Version 2.0.11

    WP Super Cache
    Version 1.4.2

     Not sure why, but I will have to leave these disabled from now on.

    Thanks again for all your help JeffMa, much appreciated sir.

     

    • Now that you have identified the problematic plugins, my recommendation would be to first update anything that may be out of date. If that doesn’t correct it, try deleting and reinstalling the plugins. Outside of that, you may want to contact the developer of the plugin. Sometimes, various plugins will interact with each other in unexpected ways so there may be some sort of issue there.

  • I appreciate you looking into the matter and the reply. On that particular page that I linked to, there is nothing special on that page that isn’t on others. There are a lot of other pages giving the 500 error and some that aren’t. I will go ahead and disable all plugins and test the page out, and then reactivate them 1 by 1. 

     

    Thanks again.

  • I’ve contacted support a couple times now regarding the 500 error. Everything was working just fine on previous web host. My main concern was getting my t-shirt pages fixed, which they were. These were fixed by basically copying all the code on the page and pasting it into a new page and saving that page the exact same name as the original, and renaming the broken one. But now that I went and checked older blog posts, there are a lot that are producing the 500 error. I contacted support earlier, and was told it may have something to do with my htcaccess file and or permalinks. I’ve done all that I could, tips even read here to resolve the issue, but I am still getting the error. I am keeping my fingers crossed that maybe someone else that has dealt with this issue at a higher extent, can finally help me to resolve it.

    Website:shaolinchamber36.com

    Link with error:https://www.shaolinchamber36.com/buddhist-blog/addiction-or-obsession/

    The link provided was on Page 54, there are a lot more posts that do not work as well.

    I would GREATLY appreciate any help with this issue. Thank you.

    • This issue appears to be directly related to a plugin running on that page. Unfortunately, I am unable to go through each of your plugins as there are quite a few, but disabling all plugins was able to resolve the issue on the page. I recommend looking through each plugin that would be active there and disabling them one by one to see if the issue is then resolved.

  • hi,
    I have a problem with ver 1.6 prestashop module payment by bank transfer to the following error

    500 Server Error

    Oops, something went wrong.

    Try to refresh this page or feel free to contact us if the problem persists.

    I also changed the permissions in the form bankwire but does not work

    can you help me?

    thanks

    • Hello Angelo,

      Sorry for the problem that you’re having. I turned on the error reporting (you can find out how to do this by going here) and discovered more specifics on the error:

      Can’t load Order status at line 174 in file classes/PaymentModule.php

      I looked up the issue and the suggested fix requires some database work.

      You have to re-insert all default order status tables. Create a fresh PrestaShop 1.6 install, and then open the database in phpmyadmin (or your favorite mySQL client). Export the following tables

      ps_order_state
      ps_order_state_lang

      Finally, import these tables into your current PrestaShop database. Please let us know if this helps to resolve the issue. If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  • Hello,

     

    I seem to be getting the 500 Error only when trying to access Plugins from my Dashboard preventing me from installing any plugins.  I have deleted all my plugins through my FTP to no avail.  Has anyone else dealt with this and discovered a solution?  I’m striking out.

    Thanks,

    Brian

    • Hello Brian,

      Sorry for the problem you were having. It was related to the version of PHP that you were running in cPanel. It was set to php5.2. I set it to PHP 5.4 and then errors stopped happening. I tested with a test admin and I was able to see the Install Plugins (and other pages) without the 500 error any more.

      Check it out – make sure to clear your browser cache before jumping into the pages. If you’re still having any problems, please let us know!

      Regards,
      Arnel C.

  • Hello, I got an 500 internal server error again, this time all my websites are down. The error log stated:

    .htaccess: AddHandler requires at least two arguments, a handler name followed by one or more file extensions

    I am not sure if I should do what I did before (changing the php.ini file to backup).

     

    Please advise before I try that

    • Hello Trevor,

      In checking your sites, they are working for me. Were you able to correct the issue?

      Kindest Regards,
      Scott M

  • Hi I have created stage website for testing before make it live. I set a password on the directory so that only i can access. Suddenly I am getting Error 500 though the home page is loading fine.

     

    mint.avirupchatterjee.com

     

    Please let me know if u need username and password to look into the issue.

    • Hello avirup,

      I can get into the site area fine but I see no 500 error. Is there a specific link or page that is giving the error?

      Kindest Regards,
      Scott M

  • Hello, I am getting an internal 500 error ([Mon Aug 11 12:34:34 2014] [error] [client 72.38.17.29] File does not exist: /home/goodba7/public_html/js/jquery.js, referer: https://goodbarsecurity.com/window-bar-selector.html)

    I have been unable to trace the error, as far as I can see I have jquery.js in that folder.

    This page is a form that sends the info to a php file to process, it was working, I am not sure what happened to cause this error.

    Let me know if you can help,

     

    Trevor

    • Hello Trevor,

      I took a long look at your error and here’s a portion of the Apache error log:

      [Mon Aug 11 12:09:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_sqlite.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_sqlite.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:09:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_xsl.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_xsl.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:09:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_zip.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_zip.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:09:57 2014] [error] [client 7x.xx.xx.xx] malformed header from script. Bad header=
      : window-bar-selector.php, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:11:05 2014] [error] [client 7x.xx.xx.xx] File does not exist: /home/goodba7/public_html/html/favicon.ico, referer: https://www.goodb-xxxxxxxx.com.com/popup-R.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_gd2.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_gd2.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_mbstring.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_mysql.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_pdo.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_pdo.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_sqlite.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_pdo_sqlite.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_sqlite.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_sqlite.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_xsl.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_xsl.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html
      [Mon Aug 11 12:14:57 2014] [error] [client 7x.xx.xx.xx] PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_zip.dll’ – /opt/php54/lib/php/extensions/no-debug-non-zts-20100525/php_zip.dll: cannot open shared object file: No such file or directory in Unknown on line 0, referer: https://goodb-xxxxxxxx.com.com/window-bar-selector.html

      ——–
      I removed your domain name and any IP references. These errors are likely the result of an server upgrade of PHP. There are a few suggestions that may help to resolve the problem:

      You can add the following to your .htaccess file (as per the post above):

      # Use PHP53 as default
      AddHandler application/x-httpd-php53 .php

      ——

      You can also try re-naming the PHP.INI file to something like PHP.BACKUP so that it uses the server default file. I’m unable to verify exactly where you’re having the problem at this point since we don’t have an exact URL. Can you try using the suggestions above and then let us know if the issue is still happening? If you do continue to have the problem, please provide more information on how we can duplicate the error so that we can investigate it further.

      Regards,
      Arnel C.

  • I couldn’t find any records in the error log regarding to my 500 error. Also the site was working before and I haven’t changed anything. It just suddenly started to show up. Could you help me with it please? Thanks!

    • Hello Zhe,

      Sorry for the troubles, I see that you’ve already contacted support about this issue and they seem to have resolved the problem.

      It looks like when your server recently had the default version of PHP updated to PHP 5.4 this possibly caused issues with your current scripts.

      In your home directory the .htaccess file had this code placed in it:

      # Use PHP53 as default
      AddHandler application/x-httpd-php53 .php

      This sets your account to revert back and use PHP 5.3 for PHP scripts instead.

      If you encounter any other similar issues on your account, you might be interested in knowing that you can run multiple versions of PHP on one account.

      Please let us know if you’re still having any issues at all.

      – Jacob

  • Thanks for all your help Jacob. Other than these new donor/donation pages the only other php on the site is to list out two workshop schedules. I’ll go through the code and upgrade the php and also change it to mySQLi as well. It had to happen sometime…LOL. This is what happens when a person learns by trial and error (once or twice a year) instead of taking formal classes.

  • okay I’m here at inmotion hosting. The login is my email address for the domain

    Everything I’m doing now should be around the login.php page, the donorList.php and those php pages in the php folder.

    • Hello Gene,

      Because you are an InMotion Hosting customer, in the future you might want to submit a ticket for this type of issue so that we know right away we have access to look around your account instead of guessing what the problem could be.

      Taking a look through your files, the following files had to be updated to include the correct path for your include_once statements:

      login.php
      db/db_connect.php
      db/functions.php
      php/process_login.php

      Once all of those were corrected the actual 500 error being logged in Apache was:

      Zend Guard Loader requires Zend Engine API version 220090626
      The Zend Engine API version 220060519 which is installed, is outdated.
      malformed header from script. Bad header=error.php?err=Could not initia: login.php

      It looks like your /home/userna5/.htaccess file has been set to default your account to use PHP 5.2, and your site was also loading your local /public_html/php.ini file which was causing the Zend Guard problem. We have a guide on Zend Optimizer vs Zend Guard that explains that Zend Optimizer can only be used on PHP 5.2 and older versions while Zend Guard is used in PHP 5.3 and newer, are you actively using either of these in your PHP scripts?

      When I temporarily moved your php.ini file out of place to php.ini-BAK so that the server-wide one is used instead, your login.php script then triggers this error:

      malformed header from script. Bad header=error.php?err=Could not initia: login.php

      If I follow our guide on using multiple versions of PHP on one account and edit your /public_html/.htaccess file to default to PHP 5.3 instead with this line:

      AddHandler application/x-httpd-php5 .php

      Your login.php page then pulls up without any errors. But then when I attempt to login using the form on that page it then redirects me to /php/process_login.php and it’s just a blank page.

      I’m not sure if you needed PHP 5.2 for other aspects of your site, so I’ve gone ahead and left the code to activate PHP 5.3 commented out in your /public_html/.htaccess file.

      Because even just a simple PHP script with phpinfo(); was still throwing a Zend error I’ve gone ahead and left your php.ini file as php.ini-BAK.

      It sounds like if you switch your account to PHP 5.3 then you just need to work on the coding of your login form, as that seems to resolve the 500 server errors.

      – Jacob

  • I can’t figure out what’s wrong with the path unless it has something to do with the php.in file. I’m not versed enough to know if it is or not.

    • Hello Gene,

      It looks like you need to change:

      include_once 'home/mediqxX/public_html/php/db_connect.php';

      To:

      include_once '/home/mediqxX/public_html/php/db_connect.php';

      Otherwise without the / the server is going to be interpreting the home directory as a relative instead of a full path, and won’t find the db_connect.php script . However once you’ve included the correct file, more than likely you’re going to get the generic 500 error again stating it can’t find your custom 500.shtml error page.

      This is because it seems like having the include set to a relative path of php/db_connect.php it was correctly finding the file so you didn’t get any PHP errors, but then something in that script then triggered a 500 internal server error. Now that you’ve placed an incorrect path PHP is catching it and displaying that error before it triggers a server error.

      You would really want to look to see why your 500 errors are not being logged and instead trying to go to a custom 500 error page. Because more than likely that is what’s ultimately hiding the real problem which is more than likely a permission issue, or PHP extension or something of that nature that you’re trying to use that the server doesn’t have.

      If you host is unable to take a look at this, we can take a look if you provide us either SSH or FTP access to the account. You can go ahead and just comment back to this post with that info and we won’t make any private information public before approving your comment to be posted.

      – Jacob

  • I believe my issue is the path in the include_once statements

    changing 

    include_once ‘php/db_connect.php’;

    to

    include_once ‘home/mediqxX/public_html/php/db_connect.php’;

    makes the 500 Internal Server error go away, but now I have 

    Warning: include_once(home/mediqxX/public_html/php/db_connect.php) [function.include-once]: failed to open stream: No such file or directory in /home/mediqxX/public_html/login.php  on line  3

    So I believe the issue is all about the path.

    • Hello Gene,

      It sounds like you’re on the right track. The new error message also provides a more specific location. Thanks for letting us know what you’ve found.

      Kindest regards,
      Arnel C.

  • The cPanel error log:

    [Tue Jun 24 11:23:57 2014] [error] [client xxx.xxx.xxx.xxx File does not exist: /home/…/public_html/500.shtml

    I’ve was getting several of these errors this morning on opening the login.php page. I cleaned them all up by fixing some of the include_once ‘myfile.php’ statement paths, but now I’m just getting this one error and I’m stuck. 

     

    • Hello Gene,

      Typically a server is setup to log any 500 internal server errors, but it seems like you might have an .htaccess file or your Apache config settings are set to ErrorDocument 500 500.shtml for custom error pages, so the only error the server is logging for you is that it can’t find that custom error document when attempting to handle a 500 error.

      Since your PHP scripts are not very long, I might recommend commenting out the entire file and then uncomment it line by line until you trigger a 500 error again to see what the culprit is. You might also want to match up the time stamp from when the 500 error was triggered in the Apache error log, with your site’s access-logs to ensure the 500 error is actually being triggered by the PHP script you think is the problem.

      – Jacob

  • I think it’s a path issue, but dammed if I can find it. I can give account info off line if you’re inclinded to look. Otherwise I’ll keep looking.

    • Hello Gene,

      Does your web host use cPanel? If so you should be able to click on Error Log under the Logs section to actually see the real error message. Or you should be able to contact them to review the Apache error log to see what the actual error message is.

      The error you’re getting now is simply stating that you’re getting a 500 internal server error and that it can’t locate the 500.shtml page to display the generic error.

      If there is a problem with your PHP script, typically PHP will spit out a line number that is causing the problem. So you more than likely are running into a permission issue, or something at the server level attempting to be loaded by PHP such as Zend Loader or another extension is having problems.

      Unfortunately really the only way to tell would be looking at the actual error message being generated on the server, and not just the front-end 500 error.

      – Jacob

  • I’m trying to set up security with php and mysqli for a small database. Opening the login page throws the 500 Internal Server error. The error log shows File does not exist: /home/…/public_html/500.shtml. 

     

    I start the login.php page:

     

    <?php

    ini_set(‘display_errors’,’On’); 

    error_reporting(E_ALL);

    include_once ‘php/db_connect.php’;

    include_once ‘php/functions.php’;

     

    sec_session_start();

     

    if (login_check($mysqli) == true) {

        $logged = ‘in’;

    } else {

        $logged = ‘out’;

    }

    ?>

     

    The functions.php page starts with this function:

     

    <?php

     

    include_once ‘php/psl-config.php’;

     

    function sec_session_start() {

        $session_name = ‘sec_session_id’;   // Set a custom session name 

        $secure = ‘SECURE’;

        

        // This stops JavaScript being able to access the session id.

        $httponly = true;

     

        // Forces sessions to only use cookies.

        if (!ini_set(‘session.use_only_cookies’, 1)) {

            header(“php/error.php?err=Could not initiate a safe session (ini_set)”);

            exit();

        }

     

        // Gets current cookies params.

        $cookieParams = session_get_cookie_params();

        session_set_cookie_params($cookieParams[“lifetime”], $cookieParams[“path”], $cookieParams[“domain”], $secure, $httponly);

     

        // Sets the session name to the one set above.

        session_name($session_name);

     

        session_start();            // Start the PHP session 

        session_regenerate_id();    // regenerated the session, delete the old one. 

    }

     

    and the db_connect.php only has

     

    <?php

     

    include_once ‘php/psl-config.php’;   // Needed because functions.php is not included

     

    $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);

    if ($mysqli->connect_error) {

        header(“php/error.php?err=Unable to connect to MySQL”);

        exit();

    }

     

    the psl-config.php page just defines the database parameters

    <?php

    /**

     * These are the database login details

     */  

    define(“HOST”, “localhost”);     // The host you want to connect to.

    define(“USER”, “me”);    // The database username. 

    define(“PASSWORD”, “*****”);    // The database password. 

    define(“DATABASE”, “mydatabase”);    // The database name.

     

    Any idea what the issue is?

    • Hello Gene,

      Thanks for the question. Since we have no way of seeing the files or error logs for your site (without any account information or access), then we’re only guessing at the possible cause of the 500 error. One thing you can do is to create a PHP file that exists on your site (something simple like “hello world!”), then use it to see if your problem is in your code. You can set the reference in difference places and then see where the problem lies. Sorry we can’t give you more specifics, but again, we would need to be able to access to the site files and logs to see what’s happening.

      Regards,
      Arnel C.

  • Hi Guys,

    Just FYI, I had the same issue that Sophie was dealing with. I removed the php.ini file from my home directory and the site worked again. 

    I’m assuming there’s lots of other people out there that may be experiencing the same issue. Thank you for making the fix public. It saved me a lot of time.

     

  • greetings!

    euhm.. what do i do if i Need to set a folder CHMOD to 777 for something? for example i’ve been trying to use some PHP scripts for showing news via MYSQL on my web, but it won’t work if i don’t set the perms to 777, somehow the “log in” from the news Admin panel brings me back to the “log in” page even if i enter the correct user and password, given in the instructions of the PHP script…

    so i’m trapped between the 500 error and the requeriments of the PHP script

    ty very much in advance. PS. if you know a good (free) PHP script that shows notices on your page and lets you modify them WYSIWYG and that works without the need of CHMODing to 777, i’d thank you Very much!

    • Setting scripts and folders to 777 is extremely dangerous. So dangerous, in fact, that setting these permissions opens your site to becoming hacked within seconds. If your script requires you to set permissions to 777, I highly recommend finding another script as this one would be very poorly coded and greatly opens you up to attack.

  • I’m back!  The site is back up now but I now get a 404 error on my comments pages.  How do I fix this?  Does this still have to do with the php.ini file?

    ‘The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.’

     

    • Hi Sophie,

      Sorry for that problem! If you recently imported a WordPress site from another location, one of the things that needs to be reset is the permalinks. This can be found in your Admin dashboard under Settings (you can also reference our article Setting up Permalinks if needed).

      To reset your permalinks you make a copy of our custom permalinks from before, then click on DEFAULT in the permalinks structure and save. This will make the links that ugly number-code string that it uses by default. After it’s saved, simply paste your custom permalinks back in and save. This will rebuild the links in the database with the correct path.

      I’ve done this for you already – as it’s a pretty quick fix, but I just wanted to let you know how that works. Let me know if you’re still seeing a problem with the pages. If you are, make sure to first clear your browser cache. This will make sure that your browser isn’t using the old paths.

      Hope that helps! Please let us know if you have any further issues!

      Regards,
      Arnel C.

    • Hello Sophie,

      Sorry for the problem! I was able to find the issue as a problem with the php.ini file. We have a default one that is running directly from the server. I set it to use that one and the site works okay now. The php.ini on your site was referencing an older function. I simply renamed it so that the server php.ini would take precedence and then the site worked fine.

      Let us know if you have any further issues!

      Kindest regards,
      Arnel C.

  • Thanks!  I’ve done a search for all .htaccess files (only two) and have renamed them as you suggested.  Now a new .htaccess file has appeared but it’s empty.  Am I supposed to do something with that file?  I still get the 500 internal server error on the site.

    • Empty .htaccess files are fine. Are you hosted with us? Could you provide me with the domain for the site that you are having issues with?

  • Ok!  I’m a total beginner at this so just to check: what should I be renaming them to?  .ht anything?  Thank you for being so quick with your replies, I really appreciate it!

  • Hi Jeff, thank you for the quick reply.  I’ve got the file open and am comparing it to a generic WordPress file but I’m afraid I don’t see anything wrong.  Do you have any other suggestions?    

    • Try renaming any .htaccess files that are within your home directory, public_html directory, or any others that may be hiding in there.

  • Hello,

    My site has been showing an internal server error since this morning but there are no errors in my error log.  What further steps can I take to try to identify the problem and resolve it?

    Thank you

    Sophie

    • This is typically caused by an issue within your .htaccess file. I recommend using the cPanel File Manager to open your .htaccess file and take a look at it.

  • Hi,
        I am trying to get a single page site up and running using a theme I purchased, but it is failing to load nearly all image assets, I am getting 500 errors in the console and network tabs of my browsers.

    I have gone through and checked the permissions of the relevant files (755) and folders (644) but haven’t found any indication why this would happen. Most of these images are static referenced from a html page.
    The url is https://thedigitalworkshop.com.au

    The weird thing is if I work out the direct URL of the image, I can navigate to that successfully, this issue is weirding me out!

    Also, I can’t see anything in the logs in CPanel…

    Any help is much appreciated.

    • Hello Chris,
      In investigating your issue I discovered two actual problems. The reason the images were not showing for the thedigitalworkshop.com.au domain is because of the .htaccess hotlink prevention code in your primary domain name. .htaccess files are recursive so the rules apply to all folders underneath them. The code was also restricting things in the addon domain since they were not from the primary domain name. I was able to correct that in a test .htaccess file.

      The second issue was that the default image you wanted to display for hotlinking was not showing up. This is why you were unable to see that this was the cause. The hotlink protection code points to an image that is also hotlink protected. This sends the server into an endless loop and will not display anything. After fixing this issue, the addon domain displayed the default image all over it. The image you want to display has to be external to the site to prevent the looping. For the test, I called an image from imgur that says Do Not Hotlink. This works well.

      Both issues were simply the result of the htaccess code for hotlinking not performing as it should. The original code is below. (example.com is used in place of your primary domain name for privacy).

      RewriteCond %{HTTP_REFERER} !^https://(.+\.)?example\.com/ [NC]
      RewriteCond %{HTTP_REFERER} !^$
      RewriteRule .*\.(jpg|gif|bmp|png)$ /images/dontsteal.jpg [L]

      While not perfect, the code below is what I ended up with. (example.com is used in place of your primary domain name for privacy).

      RewriteCond %{HTTP_HOST} ^www.example.com$ [OR]
      RewriteCond %{HTTP_HOST} example.com$
      RewriteCond %{HTTP_REFERER} !^$
      RewriteRule .*\.(jpe?g|gif|bmp|png)$ https://i.imgur.com/qX4w7.gif [L]

      I saved your original .htaccess file as .htaccess.original to preserve your original code so you can see and left the modified .htaccess file in place. Both the addon domain and the hotlinking warnign image are now working. Feel free to replace the imgur-linked image with one of your own, but remember to not store it in the hotlink protected domain.

      Kindest Regards,
      Scott M

    • Hello Luis,

      We’d need a bit more information in order to assist with your issues. It looks like currently your’re running a PrestaShop website in maintenance mode. Did you do anything to your store prior to the 500 Internal Server Errors happening?

      – Jacob

Was this article helpful? Let us know!