Welcome to WebmasterWorld Guest from 54.205.119.93

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

urgent change to suphp from php5

   
1:58 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, this is megaurgent,
My host just changed from php5 to suPHP,
and nearly all the pages on the site are called .htm
and I use this code in htaccess to have it working as php:
AddType application/x-httpd-php htm
This do not work with suPHP, my host told me to change it to AddHandler x-httpd-php .htm
which I did, but this does not work either....just donīt know what to do.
Canīt change the files to .php as there are many links to the .htm files
2:06 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Try the following:

AddHandler su-php-script .htm

3:13 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



just tried it, sorry, just the same.
3:18 pm on Oct 15, 2008 (gmt 0)



This is just from a web search so I don't know if it works, but you could try the below:

suPHP_AddHandler x-httpd-php .htm
3:25 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Andy
That did something but gave me a 500 error....
3:31 pm on Oct 15, 2008 (gmt 0)



There appear to be more lines when configuring suPHP, e.g.

suPHP_Engine on
suPHP_UserGroup user group
suPHP_AddHandler x-httpd-php5 .php5
suPHP_AddHandler x-httpd-php .php

I would test any such config changes within a subdirectory or test site to avoid any live errors.

Incidentally, the FAQ has the following which may be of use:

I have installed and configured suPHP, but PHP scripts are still not executed. Instead of returning the script output, the source code itself is returned.
Please make sure you have not only setup the fileextensions using the AddType directive but also have registered the MIME type with mod_suphp using the suPHP_AddHandler directive.

[suphp.org...]

3:38 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have thried this:
suPHP_Engine on
suPHP_UserGroup user group
suPHP_AddHandler x-httpd-php5 .php5
suPHP_AddHandler x-httpd-php .htm
and this:
suPHP_Engine on
suPHP_UserGroup user group
suPHP_AddHandler x-httpd-php .htm

but gets a 500 error as well
donīt know if I did it right.

3:43 pm on Oct 15, 2008 (gmt 0)



OK, last try ;)

I think you need to know which user and group are allowed to run the files (after suPHP_UserGroup), and modify as appropriate:


suPHP_Engine on
suPHP_UserGroup USER GROUP
AddHandler x-httpd-php .htm
suPHP_AddHandler x-httpd-php

Really though, your host should be able to tell you the correct code!

3:58 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Andy, nothing the same a 500 error,
dont know what to put in user group?' the user, well all user it should be,
the suphp thing seems to give the error.
The host has no clue, they are investigating....
4:25 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi again,

At this moment the host is investigating, at this moment donīt think their is much I can do then wait and see.

I really dont understand what is suphp and what is it for?
Is it a good thing that the host installed it?
If anybody can explain I would apreciate it.

5:01 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I think that someone in the suphp circle mentioned some difficulty in handling .htaccess
You should try to directly edit your httpd.conf.

If you do not have access to php.ini or httpd.conf
at some point consider changing of host.

6:04 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I change all my files, about 300 to .php it will work,
however there are plenty of links out there to .htm files and would not like to loose them, have good google ranking.
And if I did a 301 redirect to the same files but with extension .php, will I loose the links in google?
Or doing this or change host if the host donīt fix this soon, donīt know what to do.
6:07 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The host just answered this:
You do have access to a php.ini file (you can create it in /home/mysite/www/php.ini the httpd.conf is off limits however as thats a system file.

Can I do it in a php.ini file? If so how to do it, ever done that.
Could be a solution.

6:37 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



It has to be done in httpd not in php.ini

why do not you ask your host to edit the httpd to allow for htm
it will take them roughly one min, further it could help may other clients of that ISP, it does not change any user setup, just an improvement!
offer to pay for it, it won't cost you an arm and a leg.

10:14 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Henry,
I said that to the host so lets wait and see.
10:22 pm on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The other alternative is to continue to use the .html URLs, but to change the filenames on the server to .php - while your site still refers to URLs ending in .html as before.

To connect the two, add a rule for a rewrite (NOT a redirect) to .htaccess. The result is you have .php files on the server and your users continue to see the same .html URLs as before.

The final part of the fix involves setting up a 301 redirect from .php URLs over to .html URLs, so that the .php files cannot ever be directly indexed as .php URLs.

The Apache forum here at WebmasterWorld can likely help you with example code in various threads and a bit of help to get it working.

9:00 am on Oct 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks to all, finally the host fixed it all and it works now. So the redirection thing will wait till next time, hopefully ever.
9:14 am on Oct 16, 2008 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



What I described was a rewrite - and you only ever need that if you can't get what you really wanted to do to work.

So, what was the solution? I am sure this thread will have readers with the same problem in the future...

10:34 am on Oct 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I donīt know the solution, they did not tell me, I believe they forgot to add the extensions, as they added this (normal) to my htaccess AddType application/x-httpd-php5 .htm .html the problem must been on their end.
11:13 am on Oct 16, 2008 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Glad it's sorted, but just reading the thread I notice...

Receptional Andy: Quotes the FAQ:
...Please make sure you have not only setup the fileextensions using the AddType directive but also have registered the MIME type with mod_suphp using the suPHP_AddHandler directive....

helenp:
I have thried this:
suPHP_Engine on
suPHP_UserGroup user group
suPHP_AddHandler x-httpd-php5 .php5
suPHP_AddHandler x-httpd-php .htm
and this:
suPHP_Engine on
suPHP_UserGroup user group
suPHP_AddHandler x-httpd-php .htm

I may be missing something, but shouldn't there be an AddType directive here as well, as implied by the FAQ? (Which your host later seemed to add to your .htaccess)? Just wondering.

11:27 am on Oct 16, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Glad it's sorted out!
However I'll bet that if helenp was downloading the .htaccess we will then see that nothing drastic has been changed.
The host has probably, as I suggested, edited their httpd.conf which makes more sense than editing only the .htaccess.
12:44 pm on Oct 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I had addtype before and the host told me to change to addhandler, none worked, so nothing changed really in htaccess.
I have asked the host what was the solution, lets see if they give it to me.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month