PHP 5 on my server.

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

PHP 5 on my server.

Post by JellyFish »

I called my hosting provider and they said I am able to use PHP 5 rather then PHP 4, which I'm using.

But, in order to do this they said I need to use an htaccess file to notify my server that I would like to use php 5 as my default version.

How could I do this with an htaccess file, or is there any other way for me to set php 5 as my default version? I'm on a shared hosting server so I would be restricted to some things.

Thanks in advance.
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

add this

AddType x-mapp-php5 .php4

or

AddType x-mapp-php5 .php

not sure
try ;)
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

I tried both of them then looked at my phpinfo file. It still states 'PHP Version 4.3.11'. :(
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

That's possible, they only make sure the PHP files are actually parsed by the PHP5 engine.
It works on my server.
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

what does this give you

Code: Select all

<?php
class BaseClass {
   function __construct() {
       print "In BaseClass constructor\n";
   }
}

class SubClass extends BaseClass {
   function __construct() {
       parent::__construct();
       print "In SubClass constructor\n";
   }
}

$obj = new BaseClass();
$obj = new SubClass();
?>
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

thiscatis wrote:That's possible, they only make sure the PHP files are actually parsed by the PHP5 engine.
It works on my server.
Then why does my php version say PHP 4?

EDIT:

Code: Select all

<?php
class BaseClass {
   function __construct() {
       print "In BaseClass constructor\n";
   }
}

class SubClass extends BaseClass {
   function __construct() {
       parent::__construct();
       print "In SubClass constructor\n";
   }
}

$obj = new BaseClass();
$obj = new SubClass();

echo $obj->__construct();
?> 
returns:

Code: Select all

In BaseClass constructor In SubClass constructor
But what does that mean?
thiscatis
Forum Contributor
Posts: 434
Joined: Thu Jul 20, 2006 11:00 am

Post by thiscatis »

It means you can now use PHP5 features.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

thiscatis wrote:It means you can now use PHP5 features.
Is it? grEAT! But does this mean that I can use the built-in cURL library?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

JellyFish wrote:Is it? grEAT! But does this mean that I can use the built-in cURL library?
Wasn't cURL built into PHP 4...?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

cURL is php4, yes.
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

superdezign wrote:
JellyFish wrote:Is it? grEAT! But does this mean that I can use the built-in cURL library?
Wasn't cURL built into PHP 4...?
Well, according to Tech Support, I need cURL 7.11. He also said that PHP 5 would have the right version.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

So whats the problem?
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

Jcart wrote:So whats the problem?
Well, does php 5 compiler have cURL 7.11?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

easy to test

Code: Select all

echo curl_version();
Post Reply