Discussion:
PEAR DB and PHP 5.4
Michael Kleinert
2014-03-14 03:29:14 UTC
Permalink
Hi there - We upgraded a server to PHP 5.4 and PEAR DB no longer works
properly. I see that the project page refers to a newer project, MDB2, but
it looks like that was last updated in late 2012 so I'm not sure if that
one supports PHP 5.4.

Can anybody shed any light on this or provide guidance for a solution?

Thanks.

Mike
Christian Weiske
2014-03-14 04:55:37 UTC
Permalink
Hello Michael,
Post by Michael Kleinert
Hi there - We upgraded a server to PHP 5.4 and PEAR DB no longer works
properly. I see that the project page refers to a newer project,
MDB2, but it looks like that was last updated in late 2012 so I'm not
sure if that one supports PHP 5.4.
Can anybody shed any light on this or provide guidance for a solution?
I know that MDB2 works on 5.4, but if you're changing your code anyway
you should use PDO.

Guidance for a solution is only possible if you give us error messages
and (small) scripts that reproducible don't work.
--
Regards/Mit freundlichen GrÌßen
Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-
Michael Kleinert
2014-03-14 14:23:12 UTC
Permalink
Hi Christian -

This is not actually my code, but a client's code, so I'm trying to find
the solution for him.

Is MDB2 a drop-in replacement?

My client's page is supposed to generate an Excel spreadsheet but no longer
does that and instead generates the below - I know how to suppress the
errors, but suppressing the errors is not going to restore the
functionality, right? -

*Strict Standards*: Non-static method DB::isManip() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *2200*

*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1217*

*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1666*

*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB.php* on line *1387*

*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1683*

*Strict Standards*: Non-static method DB::isManip() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *2200*

*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1217*

*Warning*: Cannot modify header information - headers already sent by
(output started at /usr/local/lib/php/DB/common.php:2200) in
*/home/monterey/public_html/theatrical/contracts/farewelltofools/contracts/hostedit.php*
on
line *110*

*Warning*: Cannot modify header information - headers already sent by
(output started at /usr/local/lib/php/DB/common.php:2200) in
*/home/monterey/public_html/theatrical/contracts/farewelltofools/contracts/hostedit.php*
on
line *111*

*Warning*: Cannot modify header information - headers already sent by
(output started at /usr/local/lib/php/DB/common.php:2200) in
*/home/monterey/public_html/theatrical/contracts/farewelltofools/contracts/hostedit.php*
on
line *112*
"id","Code","BillOrg","BillFirstName","BillLastName","BillPosition","BillAddress","BillCity","BillState","BillPostalCode","BillCountry","BillEmail","BillCountryCode","BillPhone","BookerOrg","BookerFirstName","BookerLastName","BookerPosition","BookerAddress","BookerCity","BookerState","BookerPostalCode","BookerCountry","BookerEmail","BookerCountryCode","BookerPhone","ShipOrg","ShipFirstName","ShipLastName","ShipPosition","ShipAddress","ShipCity","ShipState","ShipPostalCode","ShipCountry","ShipEmail","ShipCountryCode","ShipPhone","ListOrg","ListAddress","ListCity","ListState","ListPostalCode","ListCountry","ListContact","ListPhone","ListOpens","ListWWW","ConfirmationEmail","ListWeight","ShowDate1","ShowDate2","ShowDate3","ShowDate4","ShowDate5","ShowDate6","ShowDate7","ShowDate8","ShowDate9","ShowDate10","Holdover","Approved","Individual","Filed","Trash","DateAdded"
"1","1", .... additional client data ....
Post by Christian Weiske
Hello Michael,
Post by Michael Kleinert
Hi there - We upgraded a server to PHP 5.4 and PEAR DB no longer works
properly. I see that the project page refers to a newer project,
MDB2, but it looks like that was last updated in late 2012 so I'm not
sure if that one supports PHP 5.4.
Can anybody shed any light on this or provide guidance for a solution?
I know that MDB2 works on 5.4, but if you're changing your code anyway
you should use PDO.
Guidance for a solution is only possible if you give us error messages
and (small) scripts that reproducible don't work.
--
Regards/Mit freundlichen GrÌßen
Christian Weiske
-=≡ Geeking around in the name of science since 1982 ≡=-
--
_______________________________________
Signup for hosting today at BigRedHosting.com
Lester Caine
2014-03-14 14:50:11 UTC
Permalink
Post by Michael Kleinert
*Strict Standards*: Non-static method DB::isManip()
The correct fix is to rewrite the code to be e_strict compliant, but in most
cases http://www.php.net/manual/en/migrating5.errorrep.php - first user note
works ...

error_reporting = E_ALL & ~E_STRICT
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Michael Kleinert
2014-03-14 15:03:22 UTC
Permalink
Thanks, but I'll leave that to the developers : ) I'm not quite capable of
rewriting their code.

Thanks Lester.
Post by Lester Caine
Post by Michael Kleinert
*Strict Standards*: Non-static method DB::isManip()
The correct fix is to rewrite the code to be e_strict compliant, but in
most cases http://www.php.net/manual/en/migrating5.errorrep.php - first
user note works ...
error_reporting = E_ALL & ~E_STRICT
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
_______________________________________
Signup for hosting today at BigRedHosting.com
Lester Caine
2014-03-14 17:47:29 UTC
Permalink
Post by Michael Kleinert
Thanks, but I'll leave that to the developers : ) I'm not quite capable of
rewriting their code.
I gave up waiting and did my own conversion on PEAR, but I don't use any of the
PEAR database stuff.
Post by Michael Kleinert
error_reporting = E_ALL & ~E_STRICT
That should work as an alternative. If it still leaves errors then it is thouse
which need reporting, but hopefully you will be successful.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Matthew Fonda
2014-03-14 18:02:40 UTC
Permalink
Hi Michael,

These are just warnings, but the code itself still works. The excel script
seems to not work because the warnings are being outputted before the excel
data. Setting the php.ini value display_errors=Off in will fix this. This
is something that should always be done in production environments.

Best regards,
--Matthew


On Fri, Mar 14, 2014 at 7:23 AM, Michael Kleinert
Post by Michael Kleinert
Hi Christian -
This is not actually my code, but a client's code, so I'm trying to find
the solution for him.
Is MDB2 a drop-in replacement?
My client's page is supposed to generate an Excel spreadsheet but no longer
does that and instead generates the below - I know how to suppress the
errors, but suppressing the errors is not going to restore the
functionality, right? -
*Strict Standards*: Non-static method DB::isManip() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *2200*
*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1217*
*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1666*
*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB.php* on line *1387*
*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1683*
*Strict Standards*: Non-static method DB::isManip() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *2200*
*Strict Standards*: Non-static method DB::isError() should not be called
statically, assuming $this from incompatible context in
*/usr/local/lib/php/DB/common.php* on line *1217*
*Warning*: Cannot modify header information - headers already sent by
(output started at /usr/local/lib/php/DB/common.php:2200) in
*/home/monterey/public_html/theatrical/contracts/farewelltofools/contracts/hostedit.php*
on
line *110*
*Warning*: Cannot modify header information - headers already sent by
(output started at /usr/local/lib/php/DB/common.php:2200) in
*/home/monterey/public_html/theatrical/contracts/farewelltofools/contracts/hostedit.php*
on
line *111*
*Warning*: Cannot modify header information - headers already sent by
(output started at /usr/local/lib/php/DB/common.php:2200) in
*/home/monterey/public_html/theatrical/contracts/farewelltofools/contracts/hostedit.php*
on
line *112*
"id","Code","BillOrg","BillFirstName","BillLastName","BillPosition","BillAddress","BillCity","BillState","BillPostalCode","BillCountry","BillEmail","BillCountryCode","BillPhone","BookerOrg","BookerFirstName","BookerLastName","BookerPosition","BookerAddress","BookerCity","BookerState","BookerPostalCode","BookerCountry","BookerEmail","BookerCountryCode","BookerPhone","ShipOrg","ShipFirstName","ShipLastName","ShipPosition","ShipAddress","ShipCity","ShipState","ShipPostalCode","ShipCountry","ShipEmail","ShipCountryCode","ShipPhone","ListOrg","ListAddress","ListCity","ListState","ListPostalCode","ListCountry","ListContact","ListPhone","ListOpens","ListWWW","ConfirmationEmail","ListWeight","ShowDate1","ShowDate2","ShowDate3","ShowDate4","ShowDate5","ShowDate6","ShowDate7","ShowDate8","ShowDate9","ShowDate10","Holdover","Approved","Individual","Filed","Trash","DateAdded"
"1","1", .... additional client data ....
Post by Christian Weiske
Hello Michael,
Post by Michael Kleinert
Hi there - We upgraded a server to PHP 5.4 and PEAR DB no longer works
properly. I see that the project page refers to a newer project,
MDB2, but it looks like that was last updated in late 2012 so I'm not
sure if that one supports PHP 5.4.
Can anybody shed any light on this or provide guidance for a solution?
I know that MDB2 works on 5.4, but if you're changing your code anyway
you should use PDO.
Guidance for a solution is only possible if you give us error messages
and (small) scripts that reproducible don't work.
--
Regards/Mit freundlichen GrÌßen
Christian Weiske
-=≡ Geeking around in the name of science since 1982 ≡=-
--
_______________________________________
Signup for hosting today at BigRedHosting.com
Loading...