...

View Full Version : Help - is my hosting set up wrong for PHP, or am I missing an index.html page?!



jim5358
01-09-2012, 03:30 AM
Ladies & Gents.

Please help! My partner is a small business owner in the UK who had a site designed in 2007. She's just recently gone on a cost cutting exercise and was looking at cutting the cost of her hosting. Her site was privately hosted by the lady that designed it. She was paying 50 a year, plus a retainer of 100 p.a for upto 3 small changes a month to be made to the site. I dont think she ever made more than 3 changes to the site since it was built.

She needed to have her site moved to a bigger, more secure hosting company to satisfy her customers data protection compliance.

She transferred the domain over to a 1and1 hosting package that supports PHP as she was told that was the code used to write her site. Her web designer emailed the files over in a zip, so that we could upload via FTP, thinking it would be a straightforward process. We upload the files no problem via an FTP client to the domain (which has been fully transferred, we tested an HTML site on there too, after a few 'fails'). Every time I/we upload the site and wait 10 minutes or so, we get an 'Error 500' message. This is a complete list of all the files we have in the zip folder from the designer:

cgi-bin
data
images
include
mail
pdfs
text
.htaccess
404.shtml
detail.php
google4bf11929b1645776.html
index.php
robots.txt

Do I need to specify the root directory to something other than '/.' in the Admin section of the hosting site? I know a little HTML, but you know what they say about a little knowledge being a dangerous thing :/ !! Am happy to zip up the file and email it if anyone could kindly have a look, otherwise we're horribly stuck! :(

Thank you!

itxtme
01-09-2012, 03:33 AM
Index.php will work as the default file type. You need to login to your control panel and view the error log to find the cause of the 500 error.

jim5358
01-09-2012, 03:36 AM
Index.php will work as the default file type. You need to login to your control panel and view the error log to find the cause of the 500 error.
Thank you very much for taking the time to reply. I'll get stuck in now and have a look. Is there a particular subfolder/file I should be looking for/at??

jim5358
01-09-2012, 04:24 AM
Still cant find what is is.... :/

itxtme
01-09-2012, 05:07 AM
The error could be anything. I am not familiar with 1&1 hosting so do not know what contro panel they use. Basically you need to view your web servers error log to see what is causing the 500 error, a 500 error produces in the log something similar



[Wed Dec 14 12:08:07 2011] [error] [client ] Premature end of script headers: redirect.cgi
[Wed Dec 14 12:08:07 2011] [error] [client ] File does not exist: /home/user/public_html/500.shtml
[Wed Dec 14 12:08:08 2011] [error] [client ] daemon couldn't find CGI process for connection 279



Until that information is avaliable we can be of know help. This may have nothing to do with PHP. You may need to contact your hosting support to get info on how to access the logs

Inigoesdr
01-09-2012, 05:14 AM
Create a text file like test.html and see if you can pull it up without error. The problem could be caused by your .htaccess file having directives in it that aren't valid with the server 1and1 uses due to their configuration being different than your previous host. Either way definitely locate the error logs as the previous poster suggested as that will generally point you to the exact issue.

jim5358
01-10-2012, 12:37 AM
Ok! I'm making progress thanks to your help. I cant get an error log from anywhere in the 1and1 control panel, but have been trying a process of elimination.
By selectively uploading files, I have now managed to get the home page to show up when I load all the files EXCLUDING the .htaccess file. Unfortunately, none of the links work to the 'sub' pages, I am getting a .404 error when I try and access each of these. If you want to see for yourselves, please feel free to look: http://www.english-works.co.uk/
So am I correct in thinking the error is in the .htaccess file?
This is the code in the file I have pasted in from notepad:

DirectoryIndex index.php index.html
AddType 'text/html; charset=ISO-8859-1' html
php_value include_path "./:../:.../"
php_flag register_globals on

Options +FollowSymLinks

RewriteEngine on
RewriteBase /

#code to rewrite static to dynamic for detail pages
RewriteRule ^intensive-english-courses/([^/]+)\.html /detail.php?option=$1&detailType=T [L]
RewriteRule ^course-structure/([^/]+)\.html /detail.php?option=$1&detailType=TB [L]
RewriteRule ^learn-english/([^/]+)\.html /detail.php?option=$1&detailType=C [L]
RewriteRule ^thankyou.html /detail.php?option=thankyou&detailType=T [L]


Any thoughts/suggestions greatly appreciated!

Jim :)

Inigoesdr
01-10-2012, 04:24 AM
Comment out these lines and see if it works:

#AddType 'text/html; charset=ISO-8859-1' html
#php_value include_path "./:../:.../"
#php_flag register_globals on

jim5358
01-10-2012, 01:00 PM
Comment out these lines and see if it works:

#AddType 'text/html; charset=ISO-8859-1' html
#php_value include_path "./:../:.../"
#php_flag register_globals on


THANK YOU. Can tell you how grateful we are for your help, this has been the cause of a weeks sleepless nights! I'm going to look this up so I understand WHY and see if I can get my head round php properly.

Thank you once again - LEGEND!!! :D

Inigoesdr
01-10-2012, 10:13 PM
I'm going to look this up so I understand WHY and see if I can get my head round php properly.
Those php_* directives are only available when PHP is running as an Apache module, and most hosts don't run PHP as a module anymore in my experience. The AddType directive is only available when the mod_mime module is installed in Apache, and it can be disabled too.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum