Temp downgrading of PHP version.

This is a discussion on Temp downgrading of PHP version. within the PHP Language forums, part of the PHP Programming Forums category; The situation I find myself in right now is that my home (read: development) machine has PHP5 installed but my ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-11-2005
Don Freeman
 
Posts: n/a
Default Temp downgrading of PHP version.

The situation I find myself in right now is that my home (read: development)
machine has PHP5 installed but my target machine (read: production) only has
version 4 installed. This has caused a couple of problems with testing
passing my code but the production machine failing. (one example is the
str_ireplace() function). I have been doing testing for the existence of a
function but I first have to know if it is exclusive to version 5 whether or
not it is necessary. Is there a flag I can set on my local machine to
temporarily downgrade my version so that I will have the same limitations as
the host machine?

Thanks,
Don Freeman


Reply With Quote
  #2 (permalink)  
Old 05-14-2005
Janwillem Borleffs
 
Posts: n/a
Default Re: Temp downgrading of PHP version.

Don Freeman wrote:
> The situation I find myself in right now is that my home (read:
> development) machine has PHP5 installed but my target machine (read:
> production) only has version 4 installed. This has caused a couple
> of problems with testing passing my code but the production machine
> failing. (one example is the str_ireplace() function). I have been
> doing testing for the existence of a function but I first have to
> know if it is exclusive to version 5 whether or not it is necessary. Is
> there a flag I can set on my local machine to temporarily
> downgrade my version so that I will have the same limitations as the
> host machine?


There is no flag, but you could install both versions and, when using
Apache, toggle modules in your httpd.conf file:

# PHP4 enabled
LoadModule php4_module modules/mod_php4.so
#LoadModule php5_module modules/mod_php5.so

# PHP5 enabled
#LoadModule php4_module modules/mod_php4.so
LoadModule php5_module modules/mod_php5.so


JW



Reply With Quote
  #3 (permalink)  
Old 05-14-2005
Andy Hassall
 
Posts: n/a
Default Re: Temp downgrading of PHP version.

On Sat, 14 May 2005 13:46:23 +0200, "Janwillem Borleffs" <jw@jwscripts.com>
wrote:

>Don Freeman wrote:
>> The situation I find myself in right now is that my home (read:
>> development) machine has PHP5 installed but my target machine (read:
>> production) only has version 4 installed. This has caused a couple
>> of problems with testing passing my code but the production machine
>> failing. (one example is the str_ireplace() function). I have been
>> doing testing for the existence of a function but I first have to
>> know if it is exclusive to version 5 whether or not it is necessary. Is
>> there a flag I can set on my local machine to temporarily
>> downgrade my version so that I will have the same limitations as the
>> host machine?

>
>There is no flag, but you could install both versions and, when using
>Apache, toggle modules in your httpd.conf file:
>
># PHP4 enabled
>LoadModule php4_module modules/mod_php4.so
>#LoadModule php5_module modules/mod_php5.so
>
># PHP5 enabled
>#LoadModule php4_module modules/mod_php4.so
>LoadModule php5_module modules/mod_php5.so


Also a PHPINIDir directive is useful, as you'll likely have a slightly
different config between the two versions, such as different loadable modules.
Probably more relevant on Windows, though - you'll need a different
extension_dir. On Unix there's more of a tendency to compile the extensions
statically into PHP.

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #4 (permalink)  
Old 05-15-2005
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: Temp downgrading of PHP version.

Don Freeman wrote:
> The situation I find myself in right now is that my home (read:

development)
> machine has PHP5 installed but my target machine (read: production)

only has
> version 4 installed. This has caused a couple of problems with

testing
> passing my code but the production machine failing. (one example is

the
> str_ireplace() function). I have been doing testing for the existence

of a
> function but I first have to know if it is exclusive to version 5

whether or
> not it is necessary. Is there a flag I can set on my local machine

to
> temporarily downgrade my version so that I will have the same

limitations as
> the host machine?


Perhaps could do a batch conversion using Alan's
<http://devel.akbkhome.com/svn/index.php/akpear/PHP_DownGrade/DownGrade.php>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:02 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0