PayPal error messages on PHP 5.3.1 - php

I'm integrating PayPal in an application written in PHP and running on PHP 5.3.1 (using Zend Engine 2.3.0).
Every time I require a PayPal SDK file or use any of the methods it prints out an enormous amount of error and warning messages.
I obviously want to keep error message reporting at the maximum level possible (at least for my code).
My problem is similar to this one (I didn't write that) https://www.x.com/message/167121#167121
I'm concerned with possible security issues and with the obvious annoying amount of messages going into the log.
Do you have any idea of how to fix/work around this?
Thanks :)
EDIT:
A sample from the warning list (there are more):
As an example (but there are more):
Strict Standards: Assigning the return
value of new by reference is
deprecated in (...)/PayPal.php on line
87
Strict Standards: Assigning the return
value of new by reference is
deprecated in (...)/PayPal.php on line
115
Strict Standards: Declaration of
PayPal::raiseError() should be
compatible with that of
PEAR::raiseError() in (...)/PayPal.php
on line 198
Strict Standards: Assigning the return
value of new by reference is
deprecated in (...)/PayPal/Hack.php on
line 78
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Value.php on line 90
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Value.php on line 93
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line 221
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line 514
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line 616
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line 617
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line 760
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line 897
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line
1055
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line
1083
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line
1109
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line
1151
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/SOAP/Base.php on line
1176
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDType.php on line
97
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDType.php on line
110
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDType.php on line
112
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Profile/Handler/Array.php
on line 53
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Profile/API.php on line
256
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDSimpleType.php on
line 69
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDSimpleType.php on
line 71
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDSimpleType.php on
line 98
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDSimpleType.php on
line 111
Strict Standards: Assigning the return
value of new by reference is
deprecated in
(...)/PayPal/Type/XSDSimpleType.php on
line 113

I assume that PayPal Code is an external library from the PEAR Package your using that isn't 5.3 Strict comparable. There quite some Code that suffers from that Problem.
Assuming you don't want to change that Code and Submit it back ( ;) ) there aren't so many things you can do.
To name the first two that come to mind:
In your wrapper Code for the Paypal access turn of E_STRICT everytime before the call and back on after.
E.g.
<?php
class myPayPalWrapper {
public function doX() {
$x = error_reporting(E_ALL & ~E_STRICT); # or something
$this->externalPaypalClass->doX();
error_reporting($x);
}
}
doesn't look really pretty and requires a good amount of code.
If your are already using a custom errorhandler in your project you could extend that to filter out all errors of that lib.
E.g.
<?php
function myErrorHandler($iErrno, $sErrstr, $sErrfile, $iErrline) {
if(error_reporting() & $iErrno) {
if(strpos("libFolder/paypal", $sErrfile) !== false) {
return true;
}
}
return false;
}
Hope that helps

Related

Strict Standards: Only variables should be assigned by reference in plugins/content/rsform/rsform.php on line 57

I get this error and I don't know how can be fixed this.
Strict Standards: Only variables should be assigned by reference in plugins/content/rsform/rsform.php on line 57
and line 57 has this code:
$mainframe =& JFactory::getApplication();
Does anybody know how to fix it ?

Open source system not work on my server

I downloaded e-Svaasthya but it does not work on my server. Please see the below errors and offer your advice to run this system on my server:
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\Installer.php on
line 107
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\Installer.php on
line 120
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 857
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 863
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 1170
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 1935
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 2955
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 3481
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 3521
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb.inc.php
on line 3540
Deprecated: Assigning the return value of new by reference is
deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb-xmlschema.inc.php
on line 355
Strict Standards: Declaration of dbTable::create() should be
compatible with dbObject::create() in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb-xmlschema.inc.php
on line 570
Strict Standards: Declaration of dbIndex::create() should be
compatible with dbObject::create() in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb-xmlschema.inc.php
on line 734
Strict Standards: Declaration of dbQuerySet::create() should be
compatible with dbObject::create() in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\classes\adodb\adodb-xmlschema.inc.php
on line 996
Strict Standards: Declaration of SQLFile::getHTML() should be
compatible with BaseAction::getHTML() in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\actions\SQLFile.php
on line 240
Deprecated: Function split() is deprecated in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\Installer.php on
line 89
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
Strict Standards: Non-static method Installer::getTestPath() should
not be called statically, assuming $this from incompatible context in
C:\xampp\htdocs\pacs_core\e-Svaasthya-0.1\installer\includes\Version.php
on line 34
e-Svaasthya is apparently not optimized for the PHP 5.4. You can contact the creators for suggestions/patches/newer version, or use PHP 5.3.

Deprecated: Function ereg_replace() is deprecated in /home/user/public_html/includes/functions.php on line 62 [duplicate]

This question already has answers here:
How can I convert ereg expressions to preg in PHP?
(4 answers)
Closed 9 years ago.
When I type my Website URL It's all right. But When I press the sub-category to view the inner content then the problem is occur. There is 5 folder in my public_html..
They are:
1.admin
2.avatars
3.FTP
4.images
5.includes
and some php files. This is a script.
I can't php.
There's some Error...
Deprecated: Function ereg_replace() is deprecated in /home/exwggayd/public_html/includes/functions.php on line 62
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 91
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 330
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 399
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/phpFlickr.php on line 468
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 228
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 324
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 602
Deprecated: Assigning the return value of new by reference is deprecated in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 621
Strict Standards: Redefining already defined constructor for class Net_URL in /home/exwggayd/public_html/includes/phpflickr/PEAR/Net/URL.php on line 122
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 590
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 591
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /home/exwggayd/public_html/includes/phpflickr/PEAR/HTTP/Request.php on line 603
#
The function.php inside the "includes" folder...may be there is the problem. But When I reload the page Everything Seems allright.
Here is the Codes...Paste on Pastebin!!
function.php# http://pastebin.com/PR4RKSJS
phpFlickr.php# http://pastebin.com/zzaVehBx
Request.php# hxxp://pastebin.com/MPfq5zAL
URL.php# hxxp://pastebin.com/yDMvA7e5
You should use preg_replace() instead.
ereg_replace() is now deprecated : http://php.net/manual/en/function.ereg-replace.php
It's a warning about using old function "ereg_replace", which could be easilly replaced by preg_replace.
For example, the code at line#62 of yours functions.php file:
$string = ereg_replace(' +', ' ', trim($string));
could be replaced to:
$string = preg_replace('# +#', ' ',trim($string));
where '#' - is a regular expresiion start and end sign, you can use "/", "|" or some others special signs instead of it ('/' it not recommended in your case, because it require to escape '/' characters in the regexp string, and, as you are "cant php", this could be difficult to you)
Other lines with "ereg_replace" can be fixed just the same way

Php, DbSimple error

I work with DbSimple in my site-engine. Everything worked fine but some time ago I began to get an error:
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\ololo\DbSimple\Generic.php on line 113
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\ololo\DbSimple\Generic.php on line 133
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\ololo\DbSimple\Mysql.php on line 73
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'mysqlErrorHandler' not found or invalid function name in Z:\home\localhost\www\ololo\DbSimple\Generic.php on line 1278
SELECT * FROM `configuration`
NULL
What can it be?
My guess is that you upgraded PHP from 5.2.x to 5.3. I've seen similar issues with Joomla.
EDIT:
Deprecated features in PHP 5.3.x

Pear error messages with PHP5.3.0

I get a LOT of errors when i Open up a newly installed PEAR package on a WAMP server.
Here's the error messages.
What can i do?
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 650
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 697
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 757
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 786
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 914
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1577
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1607
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 2038
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 2091
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 322
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1450
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1458
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Frontend.php on line 91
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Command.php on line 137
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Command.php on line 154
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1026
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Config.php on line 1033
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\DependencyDB.php on line 554
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\DependencyDB.php on line 558
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1179
Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\wamp\www\PEAR\PEAR\Registry.php on line 1183
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 199
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1504
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1516
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1524
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\ChannelFile.php on line 1527
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 492
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 511
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 530
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 574
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 607
Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\PEAR\PEAR\Common.php on line 629
"Deprecated" means that a function or feature is no longer considered a good idea and will be removed in a future version of PHP. Since these are warnings about libraries you're using, you don't need to do anything yet except to make sure your PEAR version and packages are up to date. The libraries you use will need to be updated to make these warnings go away.
In a future version of PHP, the functions listed in your warnings will go away. You will then get fatal errors if your libraries have not been updated. Before you do another big PHP upgrade, make sure you have no deprecation warnings, or check them against the PHP upgrade docs to see if you will be impacted.
If you're getting these errors in your browser, adjust your error reporting settings. One way to do it:
error_reporting(E_ALL & ~E_DEPRECATED);

Categories