homepage Welcome to WebmasterWorld Guest from 54.242.200.172
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
urgent change to suphp from php5
helenp




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

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

 

henry0




msg:3766109
 2:06 pm on Oct 15, 2008 (gmt 0)

Try the following:

AddHandler su-php-script .htm

helenp




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

just tried it, sorry, just the same.

Receptional Andy




msg:3766160
 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

helenp




msg:3766163
 3:25 pm on Oct 15, 2008 (gmt 0)

Andy
That did something but gave me a 500 error....

Receptional Andy




msg:3766172
 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...]


helenp




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

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.

Receptional Andy




msg:3766179
 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!

helenp




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

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....

helenp




msg:3766213
 4:25 pm on Oct 15, 2008 (gmt 0)

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.

henry0




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

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.

helenp




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

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.

helenp




msg:3766310
 6:07 pm on Oct 15, 2008 (gmt 0)

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.

henry0




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

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.

helenp




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

Thanks Henry,
I said that to the host so lets wait and see.

g1smd




msg:3766550
 10:22 pm on Oct 15, 2008 (gmt 0)

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.

helenp




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

Thanks to all, finally the host fixed it all and it works now. So the redirection thing will wait till next time, hopefully ever.

g1smd




msg:3766904
 9:14 am on Oct 16, 2008 (gmt 0)

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...

helenp




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

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.

penders




msg:3766960
 11:13 am on Oct 16, 2008 (gmt 0)

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.

henry0




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

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.

helenp




msg:3767006
 12:44 pm on Oct 16, 2008 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved