Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HTTP 500 Internal Server Error After Upgrading From PHP 4.4.9 to PHP 5.2.17


Azure Moon

Recommended Posts

Hi everyone!

 

I am not well versed in much of this, so please excuse my ignorance in advance. I recently hired a developer to upgrade my osCommerce site version 2.2-MS2 from PHP 4.4.9 to run on PHP 5.2.17 so that I could use the current/newest USPS shipping module. I'm still checking everything the developer did, but on my live site when I click on the Jewelry Care link in the information box I get the following:

 

HTTP 500 Internal Server Error

 

The website cannot display the page

 

Most likely causes:


  • The website is under maintenance.
  • The website has a programming error.

Now prior to the developer doing any upgrades, or changes to my web site this page worked and displayed perfectly in PHP 4.4.9, but after he was done and I switched my site over to PHP 5.2.17 I get the above error message. And if I switch my site back to PHP 4 the page works/displays perfectly.

 

My host said that the file needed to be re-coded to work on PHP 5.2.17, but the developer I hired says it's a custom page that he did not touch and that It has to do with it being based on php 4 logic and not php 5, and if I want it fixed it would cost me more money. So I'm hoping that one of the osCommerce gurus can help me out here and let me know what I have to change so hopefully I can save some money.

 

My public_html/jewelry_care.php file is:

 

 

<?php

 

/*

 

$Id: privacy.php,v 1.21 2003/02/13 04:23:23 hpdl Exp $

 

 

 

osCommerce, Open Source E-Commerce Solutions

 

http://www.oscommerce.com

 

 

 

Copyright © 2003 osCommerce

 

 

 

Released under the GNU General Public License

 

*/

 

 

 

require('includes/application_top.php');

 

 

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_JEWELRY_CARE);

 

 

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_JEWELRY_CARE));

 

?>

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html <?php echo HTML_PARAMS; ?>>

 

<head>

 

<?php

// BOF: Header Tag Controller v2.6.0

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<title><?php echo TITLE; ?></title>

<?php

}

// EOF: Header Tag Controller v2.6.0

?>

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

</head>

 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

 

<!-- header //-->

 

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

 

<!-- header_eof //-->

 

 

 

<!-- body //-->

 

<table border="0" width="100%" cellspacing="3" cellpadding="3">

 

<tr>

 

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

 

<!-- left_navigation //-->

 

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

 

<!-- left_navigation_eof //-->

 

</table></td>

 

<!-- body_text //-->

 

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<tr>

 

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<tr>

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

<td class="pageHeading" align="right"><?php echo //tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

</tr>

 

</table></td>

 

</tr>

 

<tr>

 

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

 

</tr>

 

<tr>

 

<td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">

 

<tr>

 

<td class="main"><?php echo TEXT_INFORMATION; ?></td>

 

</tr>

 

</table></td>

 

</tr>

 

<tr>

 

<td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

 

</tr>

 

</table></td>

 

<!-- body_text_eof //-->

 

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

 

<!-- right_navigation //-->

 

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

 

<!-- right_navigation_eof //-->

 

</table></td>

 

</tr>

 

</table>

 

<!-- body_eof //-->

 

 

 

<!-- footer //-->

 

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

 

<!-- footer_eof //-->

 

<br>

 

</body>

 

</html>

 

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

And there is another public_html/jewelry care file with the name of jewelry_care_.php and that is:

 

 

<?php

 

 

/*

 

 

$Id: jewelry_care_page.php,v 1.3 2001/12/20 14:14:15 dgw_ Exp $

 

 

 

 

 

The Exchange Project - Community Made Shopping!

 

 

http://www.theexchangeproject.org

 

 

 

 

 

Copyright © 2000,2001 The Exchange Project

 

 

 

 

 

Released under the GNU General Public License

 

 

*/

 

 

 

 

 

define('NAVBAR_TITLE', 'Jewelry Care');

 

 

define('HEADING_TITLE', 'Jewelry Care');

 

 

 

 

 

define('TEXT_INFORMATION', '

 

 

 

 

 

<body>

 

<b>JEWELRY CARE - HOW TO KEEP YOUR STERLING SILVER JEWELRY CLEAN AND TARNISH FREE</b>

<p>

 

Keeping your Sterling Silver jewelry clean and tarnish free may seem like an impossible task. However, you can easily keep your sterling silver jewelry clean and prevent it from tarnishing with just a few easy steps.<br>

<p>

 

Sterling silver jewelry is meant to be worn and doing so is the best way to prevent tarnish from building up, but realize that tarnish is typically caused by things we do or wear and changing your habits a bit and some helpful hints will help to prevent tarnish from happening.<br>

<p>

 

For example, leaving your sterling silver out and exposed to air and light is a major contributor to tarnish, so it is best to store your jewelry in a zip lock baggie, cloth bag or in an air tight jewelry box and out of direct light.<br>

<p>

 

<i>BEFORE</i> you put any jewelry on, be sure any applied perfume and lotion has soaked into your skin and that all hair products, especially hairspray has been applied and dried. When removing your silver jewelry, take a few seconds to wipe it off with a soft cloth, then safely store it as described above.<br>

<p>

 

Avoid exposing your sterling silver jewelry to household chemicals like bleach, ammonia and clorinated water. If your jewelry does come in contact with these chemicals, rinse your jewelry thoroughly with luke warm water and dry with a soft cloth.<br>

<p>

 

If your sterling silver jewelry begins to show signs of tarnish, it is best to use a jewelry or silver polishing cloth (like the Sunshine Polishing Cloths we sell), which are usually two sided; one side for cleaning and the second side for polishing. Simply and gently wipe your jewelry with the cleaning side first, then use the polishing side for a brilliant shine.<br>

<p>

 

Another good practice is to regularly clean your sterling silver jewelry with a liquid jewelry cleaner which can be purchased from any jeweler, or even Windex window cleaner works in a pinch. A quick dip and swish in the cleaner will help to remove build up and make the gemstones sparkle. If there is extra build up <i>gently</i> use the tiny brush included, or a soft tooth brush to gently remove it, but be very careful around the mounting/prongs as to not loosen the setting. Be sure to rinse your jewelry thoroughly with luke warm water and wipe dry with a soft cloth.<br>

<p>

 

<b><i>Please be advised that pearls SHOULD NOT be cleaned using regular jewelry cleaner or Windex as stated above. You must use a cleaner specially formulated for pearls, which can also be purchased from any jeweler.</b></i>

 

 

 

 

</body>

 

 

</html>

 

 

 

 

 

');

 

 

?>

 

 

 

 

 

So can anyone point me in the right direction as to what has to be changed in order for the page to work/display correctly again in PHP 5.2.17? Please keep in mind that I have very little experiene with all of this, but any and all help will be greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

@@Azure Moon

 

More than likely the error is in your .htaccess and could possibly be connected to any SEO URL contribution you may have installed.

 

 

 

 

Chris

Link to comment
Share on other sites

Hi Chris!

 

Boy that was quick...LOL! I do not have any SEO URL contribution installed...at least I never installed one, or had one installed. My site is basically how I bought it, which was pre-built. So how would my .htaccess file come into play with this error message? I'm just trying to get this page to display/work again without having to pay yet even more money to the developer, so any insight, or solution you can provide would be absolutely wonderful.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

Lots of things can cause a 500 (Internal Server) error. Among them are botched edits that left a blank or empty line at the beginning or end of a file. That should be easy enough to check in your host's control panel > file manager > editor. If it was due to your programmer's editing, he owes you to fix it for free. Are there any phpflag or phpvalue statements in your .htaccess file (assuming you're on an Apache server)? They belong in a php.ini file. Unless your server was upgraded at the same time, it's probably not anything in the .htaccess (but it's likely that your server was upgraded a bit, if PHP was). 666 or 777 permissions may no longer be permitted (and should not be used, anyway). I think 2.2 MS2 was already pretty much PHP 5.x compatible, as far as dealing with register global variables and long array names go, so I don't know what you paid your programmer to do. While he was at it, he probably should have brought you up to PHP 5.3 compatibility, because your host will be there before you know it. That does require a bit of editing.

 

More info on 500 errors: http://www.catskilltech.com/freeSW/SMF/faqs/index.html#err500

Link to comment
Share on other sites

Hi Phil!

 

Thank you for your reply. Again, I am not well versed at all with this stuff, so let me lay it all out and maybe that will help. I was running 2.2-MS2 with PHP 4.4.9 and an outdated version of the USPS domestic rate calacutor. I use the USPS solely for my shipping and in order for me to continue using it, I had to upgrade to the newest USPS module so it would work with their domestic rate calculator V4.

 

So I hired a developer who tried to install the newest USPS module, but he couldn't get it to work on PHP 4.4.9, so I had to pay more to have him upgrade my files/site so that it would run on PHP 5.2.17, but he stated he would update the "cart logic only". Well he did the upgrade to PHP 5.2.17, but upon me checking everything afterwards, I discovered seven different errors that were being thrown - some in the admin (1064 - You have an error in your syntax) and one on the live site when you click on Jewelry Care in the information box (HTTP 500 Internal Server Error). I immediately emailed him about them with all the details and he said that the 1064 errors were due to SQL issues not related to PHP. (3 to 6)."

 

Well I contacted my host, forwarded them the errors and they said that they were not related to mySQL and that they are due to PHP coding, so I emailed the developer again. Then I found a fix in the forums for the 1064 errors and emailed that to him. He then added that fix and the 1064 errors are now gone, but the 500 Internal Server Error still exists.

 

I agree with you in that the developer should fix this 500 error for free, but he does not agree because he said that he didn't touch it and it's a custom page that has to do with it being based on php 4 logic and not php 5. Again, the Jewelry Care page worked perfectly before the developer did anything and it also works if I switch my site back to PHP 4 through my cPanel. I only get a 500 error when my site is in PHP 5.2.17, so clearly the error is caused by whatever he did.

 

Now in regards to your response:

 

"That should be easy enough to check in your host's control panel > file manager > editor."

 

My response - How do I do that and what am I looking for?

 

"Are there any phpflag or phpvalue statements in your .htaccess file (assuming you're on an Apache server)?"

 

My response - I don't know what phpflag or phpvalue statement are? What do I need to look for?

 

"They belong in a php.ini file."

 

My response - I have a php.ini file under public_html, but it only has the floowing in it:

 

 

 

register_globals = On

 

display_errors = off

display_startup_errors = Off

error_reporting = E_ALL

 

"Unless your server was upgraded at the same time, it's probably not anything in the .htaccess (but it's likely that your server was upgraded a bit, if PHP was)."

 

My response - I don't know if the server was upgraded too.

 

"The 666 or 777 permissions may no longer be permitted (and should not be used, anyway)."

So, with all of that being said, I am hoping that someone can point me in the right direction to fix this on my own and save my bank account.

 

My response - I have everything set at either 755, 644 or the one configure file is set to 444.

 

So how do I proceed from here? So much of this is way over my head, but I'm hoping that there's an easy fix so I can save some money. Again, any and all help will be greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

So I hired a developer who tried to install the newest USPS module, but he couldn't get it to work on PHP 4.4.9, so I had to pay more to have him upgrade my files/site so that it would run on PHP 5.2.17, but he stated he would update the "cart logic only". Well he did the upgrade to PHP 5.2.17, but upon me checking everything afterwards, I discovered seven different errors that were being thrown - some in the admin (1064 - You have an error in your syntax) and one on the live site when you click on Jewelry Care in the information box (HTTP 500 Internal Server Error). I immediately emailed him about them with all the details and he said that the 1064 errors were due to SQL issues not related to PHP. (3 to 6)."

The first thing you should do is get another developer. There wasn't any reason to upgrade php in order to get USPS working. That's not to say you should not have upgraded, just not for that reason.

 

Try renaming your .htaccess file to anything else (the one in the root directory) and then refresh the page. If the page loads, that's where the problem is at. Also, I'm not clear if the problem is just with the jewelry_care.php page or with any page. Can you go to http://your domain name/privacy.php, for example, and have it load?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hey Jack!

 

Thanks for your reply! Again, I am extremely UN-versed in all of this, so excuse me, but I'm not sure how to rename my .htaccess file. So how exactly do I safely do that and not screw something else up?

 

As for other pages working in the information box, they all do...just the Jewelry Care page throws an error. Now I bought my site pre-built, so everything in the information box was already there EXCEPT for the Jewelry Care page. I had a friend add that page to my site years ago and I don't know if that has something to do with it or not, but every other page on my site, both in my admin and in my live site work. It's just the Jewelry Care page on my live site that has an error.

 

Again, it worked/displayed perfectly up until the developer upgraded my files/site. He said it was a "custom page", he didn't touch it and that he didn't include it in the estimates/costs that I've already paid in good faith AND up front, but if I want it fixed, I have to pay more. So how can I narrow this down and hopefully fix myself? Again, any and all help and suggestions will be greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

Depending on what specific "control panel" your host offers, you go into some sort of "File Manager" (in the control panel, not the very broken one in osC) and from there navigate to the file you want to rename (generally by clicking on the folders to get to its folder, and then clicking on its name). When you click on the file name, you will usually be offered some menu that includes "Rename". Click on Rename and it should give you a place to type in the new name. For example, .htaccess can be temporarily renamed to .htaccess.old. Then you see if you at least get past the 500 error. If you do, the problem is in .htaccess. If the problem is only happening on this one file, it's unlikely that it's .htaccess. Either way, restore .htaccess's name. If the problem is in that file, list it here (**** out your account name and any other sensitive information).

 

Also in the control panel's File Manager, you should be able to navigate to the jewelry_care.php file and pick from the menu "Edit". See if there seems to be one or more blank line(s) at the very beginning, before the <?php line. Delete them. Repeat for any blank line(s) at the very bottom of the file after the last ?>. Make sure there are no blanks, tabs, or other stuff on the same line before the very first <?php or after the very last ?>. Those can cause problems, too. Save the file and see if the error has gone away. If you don't need to make any changes, you should be able to quit that page without saving.

 

Is the second file you listed really "jewelry_care_.php", or is that a typo? That one is in the "english" language directory? Usually it would have the same name as the file that invokes it (jewelry_care.php). While you're at it, also check this file for blank lines at beginning and end, just as with the other one.

 

I hope your programmer, for whatever he did, brought you up to PHP 5.3 compatibility. Since the php.ini file is turning "register global variables" ON, I suspect he didn't. At some point you will lose the ability to turn them ON and the code will have to be fixed.

 

Depending on how heavily customized your store is, you may find it easier to install a new osC 2.3.1 and import/update your database, and install a few add-ons and custom pages. In any case, you are going to HAVE to learn your way around your hosting control panel and perform basic admin functions such as backing up and restoring files and the database, or else keep paying someone to do this for you.

Link to comment
Share on other sites

Hi Phil!

 

Thanks for getting back to me and explaining everything so well! Okay, this is what I've done:

 

I went into my host's cPanel File Manager and renamed the public_html/.htaccess file, but I am still getting the same 500 error, so I changed the name back.

 

I checked the public_html/jewelry_care.php file and there are NO spaces at the top, but there were some at the very bottom, so I deleted those, but I'm still getting the 500 error.

 

ALSO, the very last line of that file is:

 

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

You said that there should be no stuff before the <?php line, or after the very last ?>. - So is this okay having something on the same line as ?>?

 

I checked the public/html_jewelry_care_.php file (no it is NOT a typo and it's in the public_html) and there are NO spaces at the top, but there were some at the very bottom, so I deleted those, but I'm still getting the 500 error.

 

I went into public_html/includes/languages/english/jewelry_care.php file and checked both the very top and very bottom of the file and there are NOT any spaces.

 

As for the developer, as far as I know he only upgraded my site to work on PHP 5.2 and he NEVER even suggested that there is a PHP 5.3 on the horizon, so I guess that's something else I have to look forward to...NOT! I realize that I have a lot to learn, but I've come a long way from just buying a pre-built site, so I guess that I'm a work in progress.

 

So I don't know where, or what to check next. Again, any and all help or suggestions will be greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

This may seem a silly suggestion. Try comparing the cofde in the jewelry_care.php file to the conditions.php file. Apart from a minor name change at the top, the two files should be nearly identical.

 

You could also try copying the code from the conditions_php page into the jewelry_care.php and change the two instances near the top of the file from conditions to match that in the old jewelry_care.php file. See if that works.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

public_html/jewelry_care.php is the main "driver" code for this custom page. It's just a slight reworking of the privacy.php driver code. It reads in public_html/includes/languages/english/jewelry_care.php to define the English text for public_html/jewelry_care.php to display. That's why I was asking if that was a typo: jewelry_care_ or jewelry_care in languages/english/. It looks like it was originally named jewelry_care_page.php. Now, is that actually in public_html/ or is it in public_html/includes/languages/english/? All sorts of things look strange here. I don't think it will cause a 500 error, but possibly it could, that the language file is in the wrong place and/or is misnamed. If it's really in public_html/, I don't know how it's being found and read in.

Link to comment
Share on other sites

Hi Mr Phil!

 

Okay, in my public_html there are two jewelry care files:

 

jewelry_care.php

 

jewelry_care_.php

 

 

Then in my public_html/includes/languages/english there is is only one file

 

jewelry_care.php

 

 

I am really suspicious of the second file of jewelry_care_.php in my public_html and I don't understand why it's even in there. It just doesn't seem right to me, but again, I don't know enough about all of this to say one way or the other. I originally had a friend add the Jewelry Care page to the information box of my web site years ago (which was working up until the developer did the upgrade), but he is extremely well versed in PHP, so I doubt that he would have created an unnecessary file, or left a file in there that didn't work, or belong.

 

Now I just tried renaming the public_html/jewelry_care_.php file and then checked the page on my live site and I am still getting the 500 error...dang!

 

I did however hear back again from the developer today and he said that his upgrades did not break the page, rather, the page is dependant on php 4 to run. And basically because he didn't include that in either of his estimates, he is not going to fix it free of charge, so if I want it fixed I will have to pay more. So rather than pay more money that I really don't have, I'm going to have to continue on what has now become a quest and try to find a fix on my own.

 

So again, if anyone has any more help or suggestions, all will be greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

OK, does languages/english/jewelry_care.php look much like public_html/jewelry_care_.php? If it does (is English language text for public_html/jewelry_care.php) the jewelry_care_.php file probably isn't being called by anyone. It's probably a mistake left over from the original page development. When we get rid of the 500 error, you can just delete that file (jewelry_care_.php), as it's unused. Or, just rename it something funky and run for a while to make doubly sure it's not needed.

 

So you've looked at public_html/jewelry_care.php and public_html/includes/languages/english/jewelry_care.php, and found no blank lines at the beginning or end of either of them? Both files look OK in the editor (lines not all run together, etc.)? This error only happens when you try to invoke the jewelry_care page? I don't see anything in there which looks like it won't work in PHP 5.2, so I think your programmer is feeding you a line.

Link to comment
Share on other sites

In my experience, server error 500 is almost always due to a configuration problem with the server itself, and most often it's due to a typo, or error in the .htaccess or possibly a php.ini

 

The cause generally isn't in a PHP script, the web server isn't even getting to that point yet, the error occurs while it's still processing how to handle the page request, so it reads the config files (httpd.conf and .htaccess files) if Apache finds something that doesn't make sense, BLEH! 500 error

 

triple check you .htaccess (by far the most likely cause) be sure the directives you use are are valid for the version of Apache you run. Mod rewrite rules with regular expressions are prime candidates for hard to find errors

Just call me Dewed ...

Link to comment
Share on other sites

I've been concentrating on the two .php files, because she says it happens ONLY on this page. If it happened on multiple pages, I'd suspect something in .htaccess or php.ini. That's not impossible here, but unlikely. It wouldn't HURT to check the .htaccess and php.ini, or even double- or triple-check them, but my money is on the .php files themselves.

Link to comment
Share on other sites

Hi Phil and Dewed,

 

First in response to Phil's replies:

 

I looked at both the languages/english/jewelry_care.php page and the public_html/jewelry_care_.php page and they are similar, BUT slightly different in regards to some of the verbiage/text I have in there about caring for sterling silver jewelry.

 

For example, in the languages/english/jewelry_care.php page it has one paragraph that reads:

 

<b>First</b> - leaving your Sterling Silver out and exposed to air and light is a major contributor to tarnish. It\'s best to store your jewelry in the zip lock baggie we ship it in, a cloth bag or in an air tight jewelry box and out of direct light.<br>

<p>

 

However, in that same paragraph in the public_html/jewelry_care_.php file it has:

 

For example, leaving your sterling silver out and exposed to air and light is a major contributor to tarnish, so it is best to store your jewelry in a zip lock baggie, cloth bag or in an air tight jewelry box and out of direct light.<br>

<p>

 

Again, I did NOT add this Jewelry Care page to my web site, so I don't know why there are these two Jewelry Care files in public_html and why the verbiage would be different. Unfortunately, I have not been able to reach the friend that added this page for me right now (I'm in the US and he's in Australia), but I don't think he'll remember exactly what he did back in 2007 when he added it.

 

I checked the public_html/jewelry_care.php file and there were are NO spaces at the top of the file, BUT there were some spaces at the very bottom, so I deleted those and saved it, but I'm still getting the 500 error.

 

I went into public_html/includes/languages/english/jewelry_care.php file and checked both the very top and very bottom of the file and there are NOT any spaces.

 

I also checked the public/html_jewelry_care_.php file and there were are NO spaces at the top of the file, BUT there were some at the very bottom, so I deleted those and saved it, but I'm still getting the 500 error.

 

I also went into my cPanel, file manager and code editor for both the public_html/jewelry_care.php file and the public_html/includes/languages/english/jewelry_care.php file and they looked okay to me - no lines all run together - BUT then again I don't know exactly what I should be looking for.

 

The HTTP 500 Internal Server Error happens when I click on Jewelry Care in the information box on my live web site ONLY. No other page on my live web site, or in my admin throws any kind of error.

 

In response to Dewed's reply:

 

My .htaccess file is massively long due to blocking a ton of IP addresses and country blocks and it's too long to post here - so what should I be looking for exactly?

 

Maybe it will help if I post snippets of the .htaccess file with coding in it and leave out the deny from xx.xx.xx.xxx - so here goes:

 

At the very top of the .htaccess file it has:

 

suPHP_ConfigPath /home/azure5/public_html

 

RewriteEngine on

 

<Files 403.shtml>

order allow,deny

allow from all

</Files>

 

 

Then about one quarter of the way down in the file it has:

 

########## Begin - Rewrite rules to block out some common exploits

#

RewriteEngine on

Options +FollowSymLinks

#

# Block out any script trying to set a mosConfig value through the URL

RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]

# Block out any script trying to base64_encode

RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]

# Block out any script that includes a <script> tag in URL

RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]

# Block out any script trying to set a PHP GLOBALS variable via URL

RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

# Block out any script trying to modify a _REQUEST variable via URL

RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]

# Block hackers trying a redirect via cPath

RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]

#Block attempt to redirect to /self

RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC]

#

RewriteRule ^.* - [F]

#

########## End - Rewrite rules to block out some common exploits

 

RewriteEngine on

RewriteCond %{REQUEST_URI} \.php/login\.php [OR]

RewriteCond %{QUERY_STRING} \.php/login\.php

RewriteRule .* - [F]

 

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://azuremoonjewelry.com/.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://azuremoonjewelry.com$ [NC]

RewriteCond %{HTTP_REFERER} !^http://www.azuremoonjewelry.com/.*$ [NC]

RewriteCond %{HTTP_REFERER} !^http://www.azuremoonjewelry.com$ [NC]

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

 

 

Then a little further down I added country blocks like:

 

<Limit GET POST>

order allow,deny

# Country: CHINA

# ISO Code: CN

# Total Networks: 3,463

# Total Subnets: 330,438,912

deny from xx.xx.xx.xxx/16

 

Note - all the deny from IP address are directly below the code above - all of which I copied from www.blockacountry.com and pasted in my .htaccess file.

 

 

Then directly after all the IP address from China it starts a new country block with:

 

#

allow from all

</Limit>

 

<Limit GET POST>

order allow,deny

# Country: JAPAN

# ISO Code: JP

# Total Networks: 2,583

# Total Subnets: 202,055,936

deny from xx.xx.xx.xxx/24

 

 

And at the very end of the .htaccess file, directly below the last country block it has:

 

<Files .htaccess>

order allow,deny

deny from all

</Files>

<Files php.ini>

order allow,deny

deny from all

</Files>

 

 

Now again, the Jewelry Care page worked/displayed perfectly in PHP 4.4.9 and before the developer upgraded my site to PHP 5.2.17. Since he completed the upgrade if I switch my site back to PHP 4 (PHP 4.4.9) through my cPanel the page works/displays perfectly - I only get the error when I switch my site back again to PHP 5 (PHP 5.2.17) through my cPanel. And this is the ONLY page that throws an error.

 

As for the developer/programmer "feeding my a line" I just don't know anything anymore. He's been on the up and up with me as far as I can tell and I totally appreciate everything he's done, but this whole mess has just scrambled my mind. He has dug his heels in and insists that this 500 error has NOTHING to do with anything he did and that fixing it was not included any either of his estimates or anything we discussed, so if I want him to fix it I have to pay more. I just don't understand how if it worked before he did anything, but it doesn't work now in PHP 5, but then works again if I switch my site back to PHP 4 that how the error isn't related/caused by the work he did? I've tried numerous times to get him to change his mind and fix this for free, but I guess this is just a battle I'm not going to win with him. Sigh.

 

So as always, any and all help and/or suggestions will be greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

Check the permissions on the php file in question with your FTP program or your Web hosts cPanel.

 

Be sure the permissions are NOT 777 (that causes the 500 error on my site).

 

Permissions of 644 on php files works for me (except the /include/configure.php files)

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Stranger and stranger. OK, so if you switch back to PHP 4, the problem goes away, but in PHP 5 only this one page gets the 500 error? That would mean that it's not blank lines at the beginning or end -- that should be a consistent failure no matter what the PHP version. It must be something in either of the jewelry_care.php files' code. You showed us the public_html/ version's code, and I don't see anything amiss. Is the language version's code exactly the same as public_html's jewelry_care_.php, except for that one line difference? If you're not sure, you could post that file here.

 

If there was a problem in .htaccess, the PHP version wouldn't have any effect on it. I.e., you should consistently have (or not have) an error regardless of the PHP version. The only thing would be something in .htaccess that operates specifically on jewelry_care.php, and I don't see anything. What's in your php.ini file? Any problem in there probably would show up on all pages, but maybe there's some odd setting that only affects one or both jewelry_care.php files.

 

jewerlry_care_.php is not used for anything, so you can delete it. It's just a leftover from working with jewelry_care_page.php.

Link to comment
Share on other sites

Hi Germ and Phil!

 

Thank you so much for your responses. In repsonse to Germ's post:

 

I checked all three files - the two in public_html and the other in public_html/includes/languages/english/jewelry_care.php and all three are set to 644.

 

In response to Phil's post:

 

The Jewelry Care page on my live web site worked/displayed perfectly BEFORE the developer did anything, but after he did the upgrade and I switched my site to PHP 5 through my cPanel it DOES NOT, but if I switch my site back to PHP 4 through my cPanel it works/displays perfectly again. And yes, this is the ONLY page that gets a HTTP 500 Internal Server Error and there are NO blank lines at the beginning or ends of any of the three Jewelry Care pages.

 

And no, the two jewelry care files are different. The difference was between the two public_html files - public_html/jewelry_care.php and public_html/jewelry_care_.php.

 

My public_html/jewelry_care.php is:

 

 

<?php

 

/*

 

$Id: privacy.php,v 1.21 2003/02/13 04:23:23 hpdl Exp $

 

 

 

osCommerce, Open Source E-Commerce Solutions

 

http://www.oscommerce.com

 

 

 

Copyright © 2003 osCommerce

 

 

 

Released under the GNU General Public License

 

*/

 

 

 

require('includes/application_top.php');

 

 

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_JEWELRY_CARE);

 

 

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_JEWELRY_CARE));

 

?>

 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

<html <?php echo HTML_PARAMS; ?>>

 

<head>

 

<?php

// BOF: Header Tag Controller v2.6.0

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

<title><?php echo TITLE; ?></title>

<?php

}

// EOF: Header Tag Controller v2.6.0

?>

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

</head>

 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

 

<!-- header //-->

 

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

 

<!-- header_eof //-->

 

 

 

<!-- body //-->

 

<table border="0" width="100%" cellspacing="3" cellpadding="3">

 

<tr>

 

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

 

<!-- left_navigation //-->

 

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

 

<!-- left_navigation_eof //-->

 

</table></td>

 

<!-- body_text //-->

 

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<tr>

 

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

<tr>

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

 

<td class="pageHeading" align="right"><?php echo //tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

</tr>

 

</table></td>

 

</tr>

 

<tr>

 

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

 

</tr>

 

<tr>

 

<td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">

 

<tr>

 

<td class="main"><?php echo TEXT_INFORMATION; ?></td>

 

</tr>

 

</table></td>

 

</tr>

 

<tr>

 

<td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

 

</tr>

 

</table></td>

 

<!-- body_text_eof //-->

 

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

 

<!-- right_navigation //-->

 

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

 

<!-- right_navigation_eof //-->

 

</table></td>

 

</tr>

 

</table>

 

<!-- body_eof //-->

 

 

 

<!-- footer //-->

 

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

 

<!-- footer_eof //-->

 

<br>

 

</body>

 

</html>

 

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

And my includes/languages/english/jewelry_care.php is:

 

 

 

<?php

 

 

/*

 

 

$Id: new_page.php,v 1.3 2001/12/20 14:14:15 dgw_ Exp $

 

 

 

 

 

The Exchange Project - Community Made Shopping!

 

 

http://www.theexchangeproject.org

 

 

 

 

 

Copyright © 2000,2001 The Exchange Project

 

 

 

 

 

Released under the GNU General Public License

 

 

*/

 

 

 

 

 

define('NAVBAR_TITLE', 'Jewelry Care');

 

 

define('HEADING_TITLE', 'Jewelry Care');

 

 

 

 

 

define('TEXT_INFORMATION', '

 

 

 

 

 

<body>

 

<B><u>How to keep your Sterling Silver jewelry clean and tarnish free</b></u><br>

<p>

 

Keeping your Sterling Silver jewelry clean and tarnish free may seem like an impossible task, however, you can easily keep your Sterling Silver jewelry clean and prevent it from tarnishing with just a few easy steps.<br>

<p>

 

Sterling Silver jewelry is meant to be worn, and doing so is the best way to prevent tarnish from building up, but realize that tarnish is typically caused by things we do, or wear. Therefore, by changing your habits a bit and utilizing our helpful hints, you can help to prevent tarnish from happening.<br>

<p>

 

<b>First</b> - leaving your Sterling Silver out and exposed to air and light is a major contributor to tarnish. It\'s best to store your jewelry in the zip lock baggie we ship it in, a cloth bag or in an air tight jewelry box and out of direct light.<br>

<p>

 

<b>Second</b> - <i>BEFORE</i> you put any jewelry on, be sure that any applied perfume and/or lotion has soaked into your skin and that all hair products, especially hairspray has been applied and dried completely. When removing your Sterling Silver jewelry, take a few seconds to wipe it off with a soft cloth, then safely store it as described above.<br>

<p>

 

<b>Third</b> - avoid exposing your Sterling Silver jewelry to household chemicals like bleach or ammonia and clorinated water. If your jewelry does come in contact with these chemicals, rinse your jewelry thoroughly with luke warm water and dry with a soft cloth.<br>

<p>

 

<b>Forth</b> - regularly clean your Sterling Silver jewelry with a liquid jewelry cleaner which can be purchased from any jeweler, or even Windex window cleaner works in a pinch. A quick dip and swish in the cleaner, then rinsing with luke warm water will help to remove build up and make the gemstones sparkle. If there is extra build up, <i>gently</i> use the tiny brush included with the jewelry cleaner, or a soft tooth brush to gently remove it, but be very careful around the mounting/prongs as to not loosen the setting. Be sure to rinse your jewelry thoroughly with luke warm water and wipe dry with a soft cloth.<br>

 

<p>

 

Further, we <u>do not</u> recommend sonic jewelry cleaners that use vibration and/or sonic waves to clean any jewelry, as they tend to damage and loosen the prongs and/or settings. If you feel that you just can\'t get any extra dirt or build up off, take the item to your trusted jeweler and have them steam clean it - they usually don\'t charge for this service if you\'re a regular customer and they might just polish it up for free too!<br>

<p>

 

If your Sterling Silver jewelry does begin to show signs of tarnish, we recommend using a <A HREF="http://www.azuremoonjewelry.com/product_info.php?cPath=24&products_id=278&osCsid=0756aa34f8c22764853eb4897ace699a”_new"><u>Sunshine Polishing Cloth (Item Number FM-151543)</u></a>. We\'ve used them here in the shop for years and now offer them online to our customers. Using one couldn\'t be easier - simply and <i>gently</i> rub your Sterling Silver or Gold jewelry with the cloth, then use a soft dry cloth to buff to a brilliant shine and you\'re done! Be careful to only rub the metal and not the gemstones as some are quite soft and may scratch.<br>

<p>

 

<b><i>Please be advised that Pearls, Mother of Pearl or Opals SHOULD NOT be cleaned using regular jewelry cleaner or Windex as stated above. You must use a cleaner specially formulated for Pearls, Mother of Pearl and/or Opals, which can be purchased from any jeweler.</b></i>

 

 

 

 

</body>

');

 

 

?>

 

Here's the contents of my public_html/php.ini file:

 

 

register_globals = On

 

display_errors = off

display_startup_errors = Off

error_reporting = E_ALL

 

 

Thank you again Phil for all of your replies. I'm guessing that this is driving you a bit mad too...LOL! Hopefully you, or someone else here can find the problem with what I've provided above because I'm officially on a quest and a mission from God to get this figured out!

 

Again, any and all help and suggestions are greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

<?php echo //tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>

 

Needs to be:

 

<?php // echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>

 

The code as it is on your site causes a "500 Internal Server Error" if I try it on my site.

 

That's the wrong way to "comment out" a line of code.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Good catch. That's right... PHP 4 is lenient about improper commenting like that (leaving echo without any arguments), but PHP 5 is stricter (I've seen that kind of error before, but missed it here). That error has probably been around since the site was set up (i.e., is not the current programmer's fault).

 

The bad code

<td class="pageHeading" align="right"><?php echo //tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

could probably just be replaced with

<td class="pageHeading" align="right"> </td>

Link to comment
Share on other sites

OMG, OMG, OMG - Germ your suggestion/fix worked - NO more HTTP 500 Internal Server Error on the Jewelry Care page!!!!!!!!!!!!!!!! Thank you, thank you, thank you - YOU ROCK!!!!! And thank you to Phil and everyone who helped with all of this - I just cannot thank you enough for helping me figure out the problem and thereby saving what was left of my sanity. And you're right Phil - it had to be that way since it was set up because I never did anything to it. But what a relief...whew! Now if I could only download your brains...LOL! I did learn a lot though, so you can be proud of that!

 

I did however, discover one more problem since the developer did the upgrade, but I'm not sure if I should just add it in here, or start another post. So since this is all related to problems I've encountered since the developer did his work, I'm going to try adding it here...please don't shoot me...LOL! If I need to start a new post, just let me know.

 

Okay, after the developer did the upgrades for my site to run on PHP 5.2.17 and installed the new USPS module the order email that I receive when an order is placed has extra lines/spaces in between the sections listed in the email and in between the lines within each section. I have no clue why this would have changed, but I suspect it has something to do with the upgrades he did. I have emailed the developer, but have yet to hear back from him and I'm guessing that he'll tell me that if I want this fixed, I'll have to pay more money, just like the last problem. Now granted, it's a small problem, but I would much rather have the emails look and print like they used to.

 

 

The OLD emails looked like this and this is the way I WANT them to look again:

 

 

My Company Name

------------------------------------------------------

Order Number: xxxx

Detailed Invoice: http://www.mysite.com/account_history_info.php?order_id=xxxx

Date Ordered: Friday March 16, 2012

 

Products

------------------------------------------------------

2 x Wiggets (AB-1234-A) = $16.18

------------------------------------------------------

Sub-Total: $16.18

United States Postal Service (1 x 0.8125lbs) (Priority (2 - 3 Days)): $5.20

Handling Fee: $2.00

Total: $23.38

 

Delivery Address

------------------------------------------------------

John Doe

1234 Main St

Anytown, 12345

New York, United States

 

Billing Address

------------------------------------------------------

John Doe

1234 Main St

Anytown, 12345

New York, United States

 

Payment Method

------------------------------------------------------

PayPal IPN

 

 

NOTE - everything is single spaced and there are NO extra lines or spaces in between the sections, or in between the lines within each section. Previously if it was a really big order with lots of items and shipping to a gift recipient or something, the old order emails might have run into a second printed page, but generally all of them looked like this and printed on one page and that's the way I'd like it to be again.

 

 

But now the NEW emails I receive look like this:

 

 

My Company Name

 

------------------------------------------------------

 

Order Number: xxxx

 

Detailed Invoice: http://www.mysite.com/account_history_info.php?order_id=xxxx

 

Date Ordered: Thursday May 03, 2012

 

 

 

Products

 

------------------------------------------------------

 

1 x Wigget (AB-1234-B) = $31.49

 

------------------------------------------------------

 

Sub-Total: $31.49

 

Flat Rate (Best Way): $4.95

 

Handling Fee: $2.00

 

Total: $38.44

 

 

 

Delivery Address

 

------------------------------------------------------

 

John Doe

 

1234 Main St

 

Anytown, 12345

 

New York, United States

 

 

 

Billing Address

 

------------------------------------------------------

 

John Doe

 

1234 Main St

 

Anytown, 12345

 

New York, United States

 

 

 

Payment Method

 

------------------------------------------------------

 

PayPal IPN

 

 

 

NOTE - the extra lines/spaces in between the sections and in between the lines within each section. Again, I would like to have these emails formatted the way they used to be so that they print on one page.

 

And just an FYI - the second/NEW email was placed after the developer did the upgrades, but BEFORE he installed the new USPS module, so that's why the first order has Priority Mail listed for shipping and the new one has Flat Rate (Best Way) in case you were wondering. I had to use Flat Rate shipping until he installed the new USPS module.

 

So if anyone can offer any help or insight into this latest problem, I would greatly appreciate it. And please let me know if I have to start a new post/topic - I wasn't sure, so again, please don't shoot me!

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

Check the language files uploaded with the new USPS module.

 

I don't use that contribution so I don't know exactly what they are named or exactly where they are in the directory structure.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Hi Germ!

 

Thanks again for the fix to the 500 error - I could kiss you!!! Now for this latest issue you suggested checking the language files associated with the new USPS module, but I think you may have misunderstood me somehow, but I could be wrong because you obviously know more about this stuff than I do.

 

The problem has to do with the order email I receive after a customer completes the checkout process and an order is placed. Said emails have extra lines in between the individual sections within the emails and in between the lines within each section of the emails. These emails were NOT like this before the developer did any work and I would like to have these emails formatted the way they used to be so that they will print on one page.

 

Again, I am anything but well versed when it comes to these things and I very well may be wrong here, but what would the language files for the USPS module have to do with the format, or line spacing of the information provided in the order emails? I do not know exactly what files the developer changed or added with either the upgrade from PHP 4.4.9 to PHP 5.2.17, or with the new USPS module, but wouldn't a problem like this have to do with the file that actually creates and sends the email, which I believe it the public_html/checkout_process.php file?

 

Any and all help or suggestions will be greatly appreciated.

 

Sincerely,

 

Azure Moon

Link to comment
Share on other sites

Are these emails HTML or plain text? If HTML, look at the page source (in the email viewer) and see if each line ends in <br><br> or <br /><br />. That would tell us that each line is getting an extra "break" added for some reason. Or, is there a blank line in between each line of text? If plain text, I would assume that an extra blank line is added at each real line.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...