Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.php

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 03-09-2010, 05:16 PM
Pseudonyme
Guest
 
Posts: n/a
Default Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

Hi All !

Upgrading from PHP 4 something to PHP 5.1 leads to a master piece of
problem.

Our website was working perfectly with coding under PHP 4 or before :
"Our manager did a stupid attempt to upgrade the PHP code to PHP
5.1" ... as a result, many of our pages are not working anymore.
.... if I have a old F150 and replace it with a new F150 : that's still
the same gas so far !!!

Functions that seem not to work anymore are ISSET functions, and may
be more functions ...

Did you have in your previous experiences the problem to upgrade PHP ?

if(isset($_POST['process']))
if(!empty($loginname))

and may be more functions are not working anymore.

Thank you for any help;

Cougloff
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 03-09-2010, 05:22 PM
Greg Russell
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

In news:91cd96a0-8923-4a1f-8757-eb2ca80dd7ec@t41g2000yqt.googlegroups.com,
Pseudonyme <normancougloff@gmail.com> typed:

> if(isset($_POST['process']))
> if(!empty($loginname))
>
> and may be more functions are not working anymore.


What errors do you receive when display_errors is enabled in the php.ini
file? And why not upgrade to a current version?


Reply With Quote
  #3 (permalink)  
Old 03-09-2010, 05:39 PM
Pseudonyme
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions[EXPERT&isset]


Thank you greg for your answer.

I have no error displaid. The functions simply do not work.

Example : Post a form does not work.
Example2 : A display of a huge query that reads throughout many
tables, display nothing.

These errors are the worst, because we have no message, and I have to
try handling the complicated code in hidden process.

Example of a Post : http://tinyurl.com/y9bv3wc

Just the email address as to be filled like bob@bob.com the rest can
be ANYTHING

Thanks +
Reply With Quote
  #4 (permalink)  
Old 03-09-2010, 05:40 PM
J.O. Aho
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

Pseudonyme wrote:

> Upgrading from PHP 4 something to PHP 5.1 leads to a master piece of
> problem.
>
> Our website was working perfectly with coding under PHP 4 or before :
> "Our manager did a stupid attempt to upgrade the PHP code to PHP
> 5.1" ... as a result, many of our pages are not working anymore.
> ... if I have a old F150 and replace it with a new F150 : that's still
> the same gas so far !!!
>
> Functions that seem not to work anymore are ISSET functions, and may
> be more functions ...
>
> Did you have in your previous experiences the problem to upgrade PHP ?
>
> if(isset($_POST['process']))
> if(!empty($loginname))


When we moved our control panel from php4 to php5 (this happen due server
crash and we didn't want to install so outdated server again), the major
problem was object passed by reference. The OOP part oh PHP changed the most,
IMHO to the better.

All isset() and empty() usage continued to work as expected

I do suggest you take a look at
http://www.php.net/manual/en/migrati...compatible.php

Keep in mind that php4 default "register_globals = On" is now
"register_globals = Off", which means that posted/get values will not
automatically be stored in variables, but only accessed from the $_POST/$_GET
array.

Without exact error messages, it's not possible to give any further assistance.



--

//Aho
Reply With Quote
  #5 (permalink)  
Old 03-09-2010, 05:48 PM
J.O. Aho
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

Pseudonyme wrote:
> Thank you greg for your answer.
>
> I have no error displaid. The functions simply do not work.
>
> Example : Post a form does not work.


As globals are off, you need to do

$email = $_POST['email'];



> Example2 : A display of a huge query that reads throughout many
> tables, display nothing.


I haven't seen anything that would make mysql to fail, I suggest you test with
echoing the SQL query and run it manually to see if it do really find anything.

Use mysql_errno() and mysql_error() to see what kind of error you get, I'm
sure that the problem is that you expect values set which where posted and as
those aren't, your query has many where statements looking for a empty string
or even worse comparing a column with nothing (this generates a sql error).



--

//Aho
Reply With Quote
  #6 (permalink)  
Old 03-09-2010, 06:26 PM
Michael Fesser
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

..oO(Pseudonyme)

>Thank you greg for your answer.
>
>I have no error displaid. The functions simply do not work.


They _do_ work. Check your error reporting in the php.ini, as already
suggested:

error_reporting = E_ALL|E_STRICT
display_errors = On

Do that on a development machine, of course, not on the production
server. You do have a dev machine, don't you?

>Example : Post a form does not work.


It does work. Most likely your code is relying on a feature from 10
years ago or so called register_globals. There really was enough time to
fix such old code! Have a look at the manual about this old directive
and how to fix it. In current PHP it's just disabled by default (since
years, BTW), but in the coming PHP 6 it will be completely removed, so
you _must_ fix your code!

Simply spoken you access form values by using a superglobal array like
$_GET or $_POST, dependent on which method was used in the form
submission. Same for cookies ($_COOKIE) and session data ($_SESSION). So
if you have some form field named 'foo', you don't access it by using
the $foo variable anymore, but $_POST['foo'] for example.

>Example2 : A display of a huge query that reads throughout many
>tables, display nothing.
>
>These errors are the worst, because we have no message, and I have to
>try handling the complicated code in hidden process.


You just have a misconfigured error reporting. PHP doesn't silently stop
working (except maybe for a real crash, but even then you should find
something in the server log).

Micha
Reply With Quote
  #7 (permalink)  
Old 03-09-2010, 06:33 PM
Pseudonyme
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions[EXPERT&isset]

Thank you J.O.
I will :
- review the variable in PHP.INI (register_globals)
- "The OOP part oh PHP changed the most, IMHO to the better". I will
take my queen victoria harrap's dictionary to try getting that one )
Probably Google all that.
- review that one : http://www.php.net/manual/en/migrati...compatible.php
- MySQL should be fine. It is.
I don't believe so much in Debug mode like in C++ or UML never helped
that much ... but PHP Debug mode ? Something I know nothing about.

imagecreatetruecolor
- That Library should be recompiled with PHP say the tutorials, while
my pack for the hosting cpy is a friendly tool with Plask + PHP +
MySQL all in one ... I don't have the source code to recompile the
package and to add the GD module to build image on the fly. Searching
15 minutes ... I could not get a simple way to add this library.

I now have input from your experience, thank you... will work on all
this.

Norman Cougloff
)


Reply With Quote
  #8 (permalink)  
Old 03-09-2010, 07:03 PM
Pseudonyme
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions[EXPERT&isset]

Thank Micha :

I Will :
error_reporting = E_ALL|E_STRICT
display_errors = On

PHP Boring. What ? :
register_globals was friendly. It is much more pure and clean to
initiate yourself the variables, I agree ... but PHP is such a little
engine, it is not powerful at all. UNIX is fine and pure, but not
PHP. So, keeping register_globals would have been cool.

the COOKIE is very important to me to eat
PHP 6 is coming ... OK.

No variable at all ?
You are mentioning the PHP will not offer anymore server variables.
That's a Big change !

session_start() .. That one ? Dead ? 100% Dead ?
$_SESSION['language']... That one ?

No $_something anymore ?

Thank you for your answer that will allow to prepare developers.

Norman by Norman Cougloff

Reply With Quote
  #9 (permalink)  
Old 03-09-2010, 07:13 PM
Michael Fesser
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

..oO(Pseudonyme)

>Thank Micha :
>
>I Will :
>error_reporting = E_ALL|E_STRICT
>display_errors = On
>
>PHP Boring. What ? :
>register_globals was friendly.


It was dirty and dangerous. It was a risk for your application security
and data integrity. In short: It was a design error in PHP. Another such
stupid thing are the magic quotes (also removed in PHP 6).

>No variable at all ?
>You are mentioning the PHP will not offer anymore server variables.
>That's a Big change !


Who said that? Of course it will still all be there, just not in the
"normal" namespace where variables of the same name coming in from
different sources would overwrite each other.

>session_start() .. That one ? Dead ? 100% Dead ?


Of course not.

>$_SESSION['language']... That one ?


Still there and the correct way to access session data. But before it
was also possible to do that with $language ... and a whole bunch of
possible problems and conflicts that came along with it.

>No $_something anymore ?


Either I have written something completely wrong or you've just
misinterpreted some it.

Micha
Reply With Quote
  #10 (permalink)  
Old 03-09-2010, 09:39 PM
Eric Wilson
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions[EXPERT&isset]

On Mar 9, 2:13*pm, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Pseudonyme)
>
> >Thank Micha :

>
> >I Will :
> >error_reporting = E_ALL|E_STRICT
> >display_errors = On

>
> >PHP Boring. What ? :
> >register_globals was friendly.

>
> It was dirty and dangerous. It was a risk for your application security
> and data integrity. In short: It was a design error in PHP. Another such
> stupid thing are the magic quotes (also removed in PHP 6).
>
> >No variable at all ?
> >You are mentioning the PHP will not offer anymore server variables.
> >That's a Big change !

>
> Who said that? Of course it will still all be there, just not in the
> "normal" namespace where variables of the same name coming in from
> different sources would overwrite each other.
>
> >session_start() .. That one ? Dead ? 100% Dead ?

>
> Of course not.
>
> >$_SESSION['language']... That one ?

>
> Still there and the correct way to access session data. But before it
> was also possible to do that with $language ... and a whole bunch of
> possible problems and conflicts that came along with it.
>
> >No $_something anymore ?

>
> Either I have written something completely wrong or you've just
> misinterpreted some it.
>
> Micha


Also when dealing with old php stuff that needs to die keep an eye on
your use of $HTTP_GET_VARS / $HTTP_POST_VARS and the
register_long_arrays setting.
Reply With Quote
  #11 (permalink)  
Old 03-09-2010, 10:30 PM
Pseudonyme
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions[EXPERT&isset]

keep an eye on your use of $HTTP_GET_VARS / $HTTP_POST_VARS and the
register_long_arrays settings

..... my eye is right down there ...

But register_long_arrays ... I must know more about UNIX. But the
registers within MSFT are useful (regedit)... UNIX ?

Bob
Reply With Quote
  #12 (permalink)  
Old 03-10-2010, 12:10 AM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

Pseudonyme wrote:
> keep an eye on your use of $HTTP_GET_VARS / $HTTP_POST_VARS and the
> register_long_arrays settings
>
> .... my eye is right down there ...
>
> But register_long_arrays ... I must know more about UNIX. But the
> registers within MSFT are useful (regedit)... UNIX ?
>
> Bob


No, they aren't. They are archaic remnants in both Unix and Microsoft.
Rather, you should be using the $_GET, $_POST, etc. superglobal arrays.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #13 (permalink)  
Old 03-10-2010, 05:12 AM
J.O. Aho
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

Pseudonyme wrote:
> Thank you J.O.
> I will :
> - review the variable in PHP.INI (register_globals)


Don't enable it, you will get a more hackable site if it's on.


> - "The OOP part oh PHP changed the most, IMHO to the better". I will
> take my queen victoria harrap's dictionary to try getting that one )
> Probably Google all that.


http://fr.wikipedia.org/wiki/Program...t%C3%A9e_objet


> - review that one : http://www.php.net/manual/en/migrati...compatible.php
> - MySQL should be fine. It is.
> I don't believe so much in Debug mode like in C++ or UML never helped
> that much ... but PHP Debug mode ? Something I know nothing about.


See what Michael Fesser wrote about error_reporting and display_errors.



> imagecreatetruecolor
> - That Library should be recompiled with PHP say the tutorials, while
> my pack for the hosting cpy is a friendly tool with Plask + PHP +
> MySQL all in one ... I don't have the source code to recompile the
> package and to add the GD module to build image on the fly. Searching
> 15 minutes ... I could not get a simple way to add this library.


If you have made a php upgrade, then the gd part should have been updated too.
I do suggest you use imagick [pecl.php.net/imagick] which is far better and
faster than gd, this one do not usually come when you install php, but you
either have a extra package in the repo, or in worst case you need to install
it with pecl.



--

//Aho
Reply With Quote
  #14 (permalink)  
Old 03-10-2010, 02:40 PM
Bernd Schulz
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions [EXPERT&isset]

Am 09.03.2010 19:16, schrieb Pseudonyme:
> Did you have in your previous experiences the problem to upgrade PHP ?
>
> if(isset($_POST['process']))
> if(!empty($loginname))
>

Try:
print_r($_POST); /* What is in the array? */
exit(); /* Stop the PHP execution */

And see the result.

Reply With Quote
  #15 (permalink)  
Old 03-10-2010, 03:34 PM
Pseudonyme
Guest
 
Posts: n/a
Default Re: Upgrade to PHP 5.1 makes trashes to the PHP Functions[EXPERT&isset]


PHP still Boring : If I was changing my F150 each year in the last 50
years, I would not have passed 50 times my driving license.

An editor + consulting firm requires work load when upgrading software
versions to sell consulting hours ... but PHP ?

With that little story said : "Using imagick [pecl.php.net/imagick] to
build image on the fly. I will."

Thank you Sirs.


Reply With Quote
 
Reply

Popular Tags in the Forum
expertandisset, functions, makes, php, trashes, upgrade

Thread Tools
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 On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any disastrous or amusing upgrade stories? dawn Newsgroup comp.databases.pick 39 11-04-2009 03:44 PM
That darn apostrophe bill Newsgroup comp.lang.php 34 07-02-2009 10:10 AM
Can't upgrade php / mysql - how about sqlite? Bill H Newsgroup comp.lang.php 2 06-20-2009 01:43 PM
Macbook Upgrade Core 2 Adi@kyoko.com Newsgroup comp.lang.cobol 0 05-16-2009 11:47 AM
Imac Memory Upgrade Aukamp@fredricka.com Newsgroup comp.lang.php 0 05-16-2009 10:57 AM



All times are GMT. The time now is 06:48 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.