Unknown 500 Internal Server Error on Apache 2.2 after upgrade from Apache 1.3

I recently moved many of my old hosting accounts from an old PHP4/Apache 1.3 cPanel server to a newer PHP4/Apache 2.2 cPanel server.  All the sites are working fine, except for one.  I am getting a 500 Internal Server Error when specific URL's are accessed.  I thnk it may be related to the code below.

The orginal person who wrote this is no longer accessable and I am trying to fix this my self ASAP.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>## Omited ##</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="/styles.css" rel="stylesheet" type="text/css">

<script language="javascript" type="text/javascript" src="/flash_detect.js">
        function getFlashVersion() { return null; };

<script language="javascript" type="text/javascript">
        var flashVersion = getFlashVersion();
        if (flashVersion < 6) {



   $path = $_SERVER['DOCUMENT_ROOT'];
   $path .= "/inc_header.php";

<table border="0" cellspacing="0" cellpadding="0">
<td background="/images/1_2-2.jpg" width="546" height="49" class="large" id="dark" align="center"> Wedding Gallery </td>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="546" height="650">
   <param name="movie" value="viewer.swf">
   <param name="quality" value="high">
        <param name="wmode" value="transparent">
   <embed src="viewer.swf" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="546" height="650"></embed>

   $path = $_SERVER['DOCUMENT_ROOT'];
   $path .= "/inc_footer.php";


Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cPanel should offer you an "error log" or "raw access logs" area where you can view or download the logs.

Being able to share the exact error message will make it much easier for people to work out what's going wrong.

Is PHP working on the other sites?

And have you tried changing the opening <? tags to <?php because there's a chance that your PHP config does not recognise the short (lazy) <? tag as the start of a PHP block.
AtekiBoyAuthor Commented:
I just tried the <? tp <?php tag change and that didn't work.  I do have my error logs enabled, since I did have to tweak a few settings when I initally setup this sever, however no error_log file is being created on this account.  I really feel like it may be an Apache issue.  I thought I worked out all of the PHP4 issues that I would see during the inital move.
It's very likely to be apache, since an error in a php script will usually only get you PHP fatal errors, not 500 internal server errros.

What is different in this site compared to the ones that do work? Are you using any .htaccess files?
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Well, if it's not something in the page, then it's likely to be a RewriteRule or Redirect in your httpd.conf or .htaccess file, which conditionally only triggers on requests for the problem page (or one of the .js or .swf files).

Also, have you defined MIME types for the JavaScript and Flash files?
LinuxGuruLinux Server AdministratorCommented:
Do you have root access to server? If yes, please check the error log at the following loaction.

tail -f /usr/local/apache/logs/error_log

Now try to access the link and paste the output in error log here.
AtekiBoyAuthor Commented:
Great Idea testez.  Here is the tail output:

[Sun Apr 18 10:45:02 2010] [error] [client] SoftException in Application.cpp:256: File "/home/chicagoi/public_html/galleries/Wedding/index.php" is writeable by group
[Sun Apr 18 10:45:02 2010] [error] [client] Premature end of script headers: index.php
[Sun Apr 18 10:45:02 2010] [error] [client] File does not exist: /home/chicagoi/public_html/500.shtml

I am not using an.htaccess file and I would assume that the MIME types for JavaScript and Flash files are working since this error only occurs on some of the pages in the gallery.
LinuxGuruLinux Server AdministratorCommented:
Ok, so navigate to the "Wedding" directory and issue the following command.

chmod 644 index.php

If you still face any difficulty, please let me know.
LinuxGuruLinux Server AdministratorCommented:
Also please make sure that the directories are having 755 permission.

chmod 755 Wedding

AtekiBoyAuthor Commented:

Here are the current settings for the galleries directory and the Wedding directory.

[root@aweb02.ixdns.com] ~ >> ls -la /home/chicagoi/public_html/galleries/
total 36
drwxrwxrwx 9 chicagoi chicagoi 4096 Sep 28  2005 ./
drwxr-x--- 8 chicagoi nobody   4096 Apr 17 13:55 ../
drwxrwxrwx 4 chicagoi chicagoi 4096 Mar 31 20:33 Corporate/
drwxrwxrwx 8 chicagoi chicagoi 4096 Sep 26  2005 Holiday/
drwxrwxrwx 4 chicagoi chicagoi 4096 Oct 21  2005 IceBars-Luges/
drwxrwxrwx 4 chicagoi chicagoi 4096 Oct 21  2005 TablePieces-Sorbets/
drwxrwxrwx 8 chicagoi chicagoi 4096 Sep 28  2005 Themed/
drwxrwxrwx 4 chicagoi chicagoi 4096 Apr 17 16:58 Wedding/
drwxrwxrwx 4 chicagoi chicagoi 4096 Oct 21  2005 WinterFestivals/
[root@aweb02.ixdns.com] ~ >> ls -la /home/chicagoi/public_html/galleries/Wedding/
total 64
drwxrwxrwx 4 chicagoi chicagoi  4096 Apr 17 16:58 ./
drwxrwxrwx 9 chicagoi chicagoi  4096 Sep 28  2005 ../
-rwxrwxrwx 1 chicagoi chicagoi  6828 Sep 28  2005 buildgallery.php*
-rwxrwxrwx 1 chicagoi chicagoi  2178 Sep 28  2005 flash_detect.js*
-rwxrwxrwx 1 chicagoi chicagoi  1403 Sep 28  2005 get_flash_player.gif*
-rwxrwxrwx 1 chicagoi chicagoi  4331 Oct 21  2005 imageData.xml*
drwxrwxrwx 2 chicagoi chicagoi  4096 Sep 28  2005 images/
-rwxrwxrwx 1 chicagoi chicagoi  1535 Apr 17 16:58 index.php*
-rwxrwxrwx 1 chicagoi chicagoi   503 Sep 28  2005 readme.txt*
drwxrwxrwx 2 chicagoi chicagoi  4096 Sep 28  2005 thumbs/
-rwxrwxrwx 1 chicagoi chicagoi   789 Oct  2  2005 upgrade.html*
-rwxrwxrwx 1 chicagoi chicagoi 12100 Sep 28  2005 viewer.swf*
LinuxGuruLinux Server AdministratorCommented:
Go to public_html and issue the following command.

chmod -R 755 galleries

Let me know the results.
AtekiBoyAuthor Commented:

I did the command and the result was... 100% Success!  Thank you so much!  If you don't mind me asking, what was wrong with the file permissions?
LinuxGuruLinux Server AdministratorCommented:
Glad to know that... :)

As you can see the permissions for the folders was set to 777. ie drwxrwxrwx which is world writable and it is security risk. That suggests that your server's apache configuration doesn't allow you to make folders writable by group. As a part of security precaution most of the servers are configured to set max permission to 755  only. You can also check with your hosting company to find out what permissions you're allowed to set.

And there is no need to worry setting the permission to 755. Your folders are now secure. :)

Let me know if you have any questions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AtekiBoyAuthor Commented:
The Expert was even nice enought to explain why his answer worked and what had happened to cause the issue.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.