Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2012, 02:30 AM   PM User | #1
jim5358
New to the CF scene

 
Join Date: Jan 2012
Posts: 9
Thanks: 4
Thanked 0 Times in 0 Posts
jim5358 is an unknown quantity at this point
Question Help - is my hosting set up wrong for PHP, or am I missing an index.html page?!

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!
jim5358 is offline   Reply With Quote
Old 01-09-2012, 02:33 AM   PM User | #2
itxtme
Regular Coder

 
Join Date: Jun 2009
Posts: 105
Thanks: 3
Thanked 17 Times in 17 Posts
itxtme is an unknown quantity at this point
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.
itxtme is offline   Reply With Quote
Users who have thanked itxtme for this post:
jim5358 (01-09-2012)
Old 01-09-2012, 02:36 AM   PM User | #3
jim5358
New to the CF scene

 
Join Date: Jan 2012
Posts: 9
Thanks: 4
Thanked 0 Times in 0 Posts
jim5358 is an unknown quantity at this point
Quote:
Originally Posted by itxtme View Post
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 is offline   Reply With Quote
Old 01-09-2012, 03:24 AM   PM User | #4
jim5358
New to the CF scene

 
Join Date: Jan 2012
Posts: 9
Thanks: 4
Thanked 0 Times in 0 Posts
jim5358 is an unknown quantity at this point
Still cant find what is is.... :/
jim5358 is offline   Reply With Quote
Old 01-09-2012, 04:07 AM   PM User | #5
itxtme
Regular Coder

 
Join Date: Jun 2009
Posts: 105
Thanks: 3
Thanked 17 Times in 17 Posts
itxtme is an unknown quantity at this point
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

Code:
[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
itxtme is offline   Reply With Quote
Users who have thanked itxtme for this post:
jim5358 (01-09-2012)
Old 01-09-2012, 04:14 AM   PM User | #6
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
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.
Inigoesdr is offline   Reply With Quote
Users who have thanked Inigoesdr for this post:
jim5358 (01-09-2012)
Old 01-09-2012, 11:37 PM   PM User | #7
jim5358
New to the CF scene

 
Join Date: Jan 2012
Posts: 9
Thanks: 4
Thanked 0 Times in 0 Posts
jim5358 is an unknown quantity at this point
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
jim5358 is offline   Reply With Quote
Old 01-10-2012, 03:24 AM   PM User | #8
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Comment out these lines and see if it works:
Code:
#AddType 'text/html; charset=ISO-8859-1' html
#php_value include_path "./:../:.../"
#php_flag register_globals on
Inigoesdr is offline   Reply With Quote
Old 01-10-2012, 12:00 PM   PM User | #9
jim5358
New to the CF scene

 
Join Date: Jan 2012
Posts: 9
Thanks: 4
Thanked 0 Times in 0 Posts
jim5358 is an unknown quantity at this point
Quote:
Originally Posted by Inigoesdr View Post
Comment out these lines and see if it works:
Code:
#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!!!
jim5358 is offline   Reply With Quote
Old 01-10-2012, 09:13 PM   PM User | #10
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Quote:
Originally Posted by jim5358 View Post
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.
Inigoesdr is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:46 AM.


Advertisement
Log in to turn off these ads.