Jump to content

.htaccess to allow for .PHP5


Guest ian_t

Recommended Posts

Guest ian_t

I have been told by my web hosting to add .php5 extensions to all my .php files to make it work as as php5. Does anyone know if this work for CubeCart code?, the hosting said I could edit the .htacces file but they didn’t say what to edit. I have found in the fourms to add “AddHandle application/x-httpd-php5 .php†to this file is this correct and where to I add it?

My .htaccess file contains this

##########################################

# Uncomment/Comment the following to #

# disable/enable public viewing of the #

# sites #

##########################################

<Files *.html>

order deny,allow

deny from all

allow from 192.168.0.

</Files>

Link to comment
Share on other sites

Guest Brivtech

Some hosts offer both php4 and php5 running together. The difference in extension assignes the scripts to the relevant php engines. Really, if your host does this, you should be able to set the default php version (as php), rather than having to manually change the file extensions.

There may be another way around this, which is setting php5 as the default, so you don't need to change the actual file extensions.

To quote my own hosting FAQs, which perhaps explains it a little clearer:

By default, files with a .php extension run under PHP 4 and files with the .php5 extension run under PHP 5. The .htaccess file, located at the root of your site, can be used to change these default settings. The following entries in a directory's .htaccess file designate .php files to run under PHP 5 and .php4 files to run under PHP 4.

AddHandler x-httpd-php5 .php

AddHandler x-httpd-php .php4

Changes made to an existing .htaccess file will be seen immediately. When a new .htaccess file is created or an existing .htaccess file is deleted, however, these changes will not be seen until the htaccess cache is cleared. This occurs every hour.

So, simply add it to the beginning of the .htaccess file.

Link to comment
Share on other sites

Guest ian_t

Thanks for your fast response. Unfortunately I can’t access my .htaccess file for editing, my host said ‘I’ll need a dedicated server £50+ per month’ I don’t think so.

I’ll have to try the .php5 extension option as this is there only way of adding the php5 phaser. I think I’ll probably stick with CC4.1.1 until my hosting period runs out then find a new host.

Link to comment
Share on other sites

Guest Brivtech

This has to be the worst example of bad hosting I have ever heard. Any host that doesn't let you edit the .htaccess file should not be in business.

Even on a cheap shared hosting account, you should be able to do this.

Are you sure you have the correct information? You quoted the .htaccess file at the beginning.

Who is the host?

Link to comment
Share on other sites

Guest ian_t

Here is the response I received from my host when I asked again when they will be switching to php5.

##########################################

Hi,

This is currently in the pipeline, although I'm afraid we do not have a a timescale at the moment for when this will be implemented.

If you do desperately need .php files to be parsed by PHP 5, and you aren't able to rename files to .php5, then I can only suggest that you host the site on one of our VPS or dedicated server packages. If you would like further information on these, please call our dedicated server team on 0845 363 3635

###########################################

I don’t know if I can mention hosts in these forums but I’m with names.co.uk

I don’t fancy changing all my extensions as some of the coding in the files might point to a .php extension which will then not exist. CC4.1.1 is currently working fine for me so I’ll have to let time tell before I can update. I will wait it out till they introduce the php5 if they haven’t introduced it before my prepaid hosting runs out I will be moving host.

Link to comment
Share on other sites

Guest EverythingWeb

Strange, as their Starter+ and Business+ shared hosting packages come with PHP4 & PHP5 according to their website!!

Link to comment
Share on other sites

Guest dreamdancer

Here is the response I received from my host when I asked again when they will be switching to php5.

##########################################

Hi,

This is currently in the pipeline, although I'm afraid we do not have a a timescale at the moment for when this will be implemented.

If you do desperately need .php files to be parsed by PHP 5, and you aren't able to rename files to .php5, then I can only suggest that you host the site on one of our VPS or dedicated server packages. If you would like further information on these, please call our dedicated server team on 0845 363 3635

###########################################

I don’t know if I can mention hosts in these forums but I’m with names.co.uk

I don’t fancy changing all my extensions as some of the coding in the files might point to a .php extension which will then not exist. CC4.1.1 is currently working fine for me so I’ll have to let time tell before I can update. I will wait it out till they introduce the php5 if they haven’t introduced it before my prepaid hosting runs out I will be moving host.

That is outrageous! Even Earthlink who were a bit difficult allowed me to create a .htaccess file (through their control panel) to change the extensions. Do you realize what a nightmare it would be to change that extension throughout the whole code of the Cube Cart store? (not to mention what it could break) And dedicated hosting is expensive.

I use GoDaddy quite a bit, they have their issues, but they are running both php 4 and now php 5.2.5, they are reasonably priced. So if 4.1.1 is working for you then stay for now, but I would move as soon as you can. I had to leave a host that would not consider the needs of those being hosted. They were progressive, in fact all they would run was php 5, but they refused to turn off safe mode or register globals. That made so many of the php programs I use such as phpList, Gallery and others unusable. Made my life such a nightmare that I moved all of my clients off of their hosting and switched to GoDaddy. I am much happier now. You know, you just can't put a price on sanity. GoDaddy may not be the answer for you, but there are plenty of hosting companies who would be.

Link to comment
Share on other sites

Guest dreamdancer

Strange, as their Starter+ and Business+ shared hosting packages come with PHP4 & PHP5 according to their website!!

And *2* SQL databases for both of those plans! What a joke. I pay half of that (if I have figured out my conversion rates properly) for 25 SQL databases and I can have as many domain names hosted on there as I wish. Plus more space and bandwidth than me and my various clients I am sharing with can use. And SSL is only $30 a year. And GoDaddy is very good about support.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...