PHP in HTML and GoDaddy
Hi,
I have a client who's site is hosted by GoDaddy. Ugh. I have successfully put php code into HTML pages and can get them to be parsed by modifying the .htacess file with a "AddHandler x-httpd-php .html .htm .cgi .php".
However, as soon as I add that to the .htaccess file, the stats interface that GoDaddy provides them does not work. I get this:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Apache/1.3.33 Server at anokacountyonline.com Port 80
If I remove the .html from "AddHandler x-httpd-php .html .htm .cgi .php".
stats work again, but obviously my php does not. I have tried other AddHandler and AddType lines that do not work for the php side of it.
GoDaddy gives my client no access to error logs or any kind of access to the stats folder. I checked the .html pages in the stats folder and it's straight html. I am not sure why having .html parsed through php first would screw things up in the folder.
Any help appreciated!
webwiz posted this at 20:11 — 5th September 2007.
He has: 629 posts
Joined: May 2007
You don't say so, but presumably you have tried renaming your files to *.htm instead of *.html?
Anyway, my suggestion was going to be "try using the x-bit hack". Sadly, although there are many references to "x-bit hack" when I google for it, I have not come across instructions for how to apply it... !!???
If any one has a reference for the x-bit hack, please let us know. I think it will solve Adobery's problem.
Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;
JeevesBond posted this at 21:08 — 5th September 2007.
He has: 3,956 posts
Joined: Jun 2002
That's really odd. I haven't got many ideas on what the problems might be, and certainly no way of fixing them without the help of GoDaddy.
If I were in your shoes I would contact GoDaddy's support. I've also been reading that people are having problems because although they purchase Linux hosting they're being given Windows (with Apache and PHP, but still things like this don't work). Get on the line and give 'em something to worry about, and if you've been given Windows instead of Linux I'd like to hear about it, that's a story I'd love to write about!
a Padded Cell our articles site!
adobery posted this at 21:43 — 6th September 2007.
They have: 3 posts
Joined: Sep 2007
I think I figured out what might be causing the problem. My client is on a shared server, and folder in which all stats reside only gives me permission to view files, no write or exe. I cannot modify the permissions.
So is it possible that with permissions set like this that pages cannot be sent to a parser on the server first?
Anyway, I figured a work-around. I created a page with a script that copies all the files out of the 'stats' folder and places them in a new folder ('statistics') then redirects the browser to the index of 'statistics'.
Contact support is a joke. I've been told:
1) We cannot help you with scripting problems (fine).
2) You have no access to error logs
3) No we cannot send you partial error log or look up error logs from such and such a date.
adobery posted this at 21:50 — 6th September 2007.
They have: 3 posts
Joined: Sep 2007
Ok Webwiz,
I just did a quick test, and renaming the files to .htm and deleting the .html part of the AddHandler let both php be parsed in the .htm pages and let the stats be viewed without errors.
I really don't feel like renaming all the .html and changing all the references inside scripts just to please the GoDaddy gods since I found a workaround, but...
...that still leaves me wondering why it won't let pages from the stats folder be parsed for php. All the pages in the stats folder are .html which I cannot view without error. However I can view the image files from that folder if typed it in the browser. So I assume that if the files were .htm files in the stats folder I would have to remove '.htm' from my AddHandler and rename all .htm to .html files.
Why can't the files be parsed?
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.