Click here to get back home

PHP4 to PHP5

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
PHP4 to PHP5 Jeff 07-19-2008
Get Chitika Premium
Posted by Jeff on July 19, 2008, 4:41 pm
Please log in for more thread options
I'm working on a server that is running PHP4.

I'd like to upgrade this so I can use the PHP5 code I have already.

What kind, if any, problems will I have with the existing PHP code base?

I see:

Local Master

magic_quotes_gpc        On        On
magic_quotes_runtime        Off        Off

I'm not sure what that means. I think that means that anything coming in
on $_REQUEST is backslashed and I'm thinking that probably won't play
well with PDO. If I turn that off what kind of failure could I see in
the existing code? Is that only a problem in that single quotes will be
backslashed in the data? Or can I have runtime crashes?

Jeff

Posted by Twayne on July 19, 2008, 8:41 pm
Please log in for more thread options
> I'm working on a server that is running PHP4.
>
> I'd like to upgrade this so I can use the PHP5 code I have already.
>
> What kind, if any, problems will I have with the existing PHP code
> base?
> I see:
>
> Local Master
>
> magic_quotes_gpc On On
> magic_quotes_runtime Off Off
>
> I'm not sure what that means. I think that means that anything coming
> in on $_REQUEST is backslashed and I'm thinking that probably won't
> play well with PDO. If I turn that off what kind of failure could I
> see in the existing code? Is that only a problem in that single
> quotes will be backslashed in the data? Or can I have runtime crashes?
>
> Jeff

We probably don't have similar code, but I made the switch and had zero
problems of any kind. The only problem I ran into was I discovered
filter_var in 5.2.5 and then discovered my ISP is only at 5.2.2, which
doesn't support it. So at least from my viewpoint, I'd say just make
sure you're at the same level your server provides. I just made the
switch on the server and ran a phpinfo() to get the full rev, then ran
one on my own system and compared the two. Past 5.2.2 there were some
pretty useful additions but I don't know them all by heart.

HTH

Twayne



Posted by Jerry Stuckle on July 19, 2008, 8:42 pm
Please log in for more thread options
Jeff wrote:
> I'm working on a server that is running PHP4.
>
> I'd like to upgrade this so I can use the PHP5 code I have already.
>
> What kind, if any, problems will I have with the existing PHP code base?
>
> I see:
>
> Local Master
>
> magic_quotes_gpc On On
> magic_quotes_runtime Off Off
>
> I'm not sure what that means. I think that means that anything coming in
> on $_REQUEST is backslashed and I'm thinking that probably won't play
> well with PDO. If I turn that off what kind of failure could I see in
> the existing code? Is that only a problem in that single quotes will be
> backslashed in the data? Or can I have runtime crashes?
>
> Jeff
>

The change from php4 to php5 probably won't be too painful. Virtually
everything I've written for php4 runs fine on php5.

The magic_quotes_gpc may be another problem, however. You should have
it off (it will be removed in php6 because it never really worked). If
you've been depending on it being on, you'll have some code to change.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Posted by Chuck Anderson on July 19, 2008, 9:18 pm
Please log in for more thread options
Jeff wrote:

> I'm working on a server that is running PHP4.
>
> I'd like to upgrade this so I can use the PHP5 code I have already.
>
> What kind, if any, problems will I have with the existing PHP code base?
>
> I see:
>
> Local Master
>
> magic_quotes_gpc On On
> magic_quotes_runtime Off Off
>
> I'm not sure what that means. I think that means that anything coming in
> on $_REQUEST is backslashed and I'm thinking that probably won't play
> well with PDO. If I turn that off what kind of failure could I see in
> the existing code? Is that only a problem in that single quotes will be
> backslashed in the data? Or can I have runtime crashes?
>
> Jeff
>
>


Just yesterday I ran into a problem with an old script I hadn't used in
a very long while. It accessed uploaded files via $HTTP_POST_FILES,
which was still around in Php 4, but is gone in Php 5 (use $_FILES).

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Nothing he's got he really needs
Twenty first century schizoid man.
***********************************


Posted by Jerry Stuckle on July 19, 2008, 9:54 pm
Please log in for more thread options
Chuck Anderson wrote:
> Jeff wrote:
>
>> I'm working on a server that is running PHP4.
>>
>> I'd like to upgrade this so I can use the PHP5 code I have already.
>>
>> What kind, if any, problems will I have with the existing PHP code
>> base?
>>
>> I see:
>>
>> Local Master
>>
>> magic_quotes_gpc On On
>> magic_quotes_runtime Off Off
>>
>> I'm not sure what that means. I think that means that anything coming
>> in on $_REQUEST is backslashed and I'm thinking that probably won't
>> play well with PDO. If I turn that off what kind of failure could I
>> see in the existing code? Is that only a problem in that single quotes
>> will be backslashed in the data? Or can I have runtime crashes?
>>
>> Jeff
>>
>>
>
>
> Just yesterday I ran into a problem with an old script I hadn't used in
> a very long while. It accessed uploaded files via $HTTP_POST_FILES,
> which was still around in Php 4, but is gone in Php 5 (use $_FILES).
>

Yes, that could be. But even $HTTP_POST_FILES is still available (but
deprecated). You enable it with register_long_arrays=on in the php.ini
file.

BTW - $_FILES and the rest have been around since php 4.1. Any code
written since then should be using the new arrays. But I also suspect
your code was written before then :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================


Similar ThreadsPosted
Using PHP4 or PHP5 October 2, 2004, 2:12 pm
PHP4 Dom XML to PHP5 XML August 3, 2005, 11:27 pm
PHP4 Dom XML to PHP5 XML August 11, 2005, 3:14 pm
XML package for PHP4 and PHP5 September 16, 2004, 1:47 am
PHP4 PHP5 under Apache 2.0 December 29, 2004, 2:38 pm
PHP4 + PHP5 + ZendStudio January 16, 2005, 1:29 pm
mail() different php4 <-> php5 May 31, 2005, 10:35 am
PHP4+PHP5+Apache 1 July 13, 2005, 7:07 am
Howto: PHP4 Dom XML to PHP5 XML ? August 11, 2005, 3:21 pm
how much more RAM does PHP5 use compared to PHP4.4? January 3, 2006, 3:08 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap