how to install the Pear db.php package ?

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

how to install the Pear db.php package ?

Postby JahnHauser » 15. July 2010 19:36

Hi,
Can somebody please give me an idea how to install the DB.php per package.

Thanks a lot in advance
JahnHauser
 
Posts: 7
Joined: 12. July 2010 18:01

Re: how to install the Pear db.php package ?

Postby MegaChriz » 16. July 2010 12:13

I don't have experience with PEAR yet, but won't it just work if you put the package inside the PEAR folder?
/Applications/XAMPP/xamppfiles/lib/php/pear/PEAR
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X

Re: how to install the Pear db.php package ?

Postby JahnHauser » 16. July 2010 22:28

Hi MegaChriz,

Thank you very much for your suggestion.

I did that and getting the following error:

----------------------------------------------------
Deprecated: Assigning the return value of new by reference is deprecated in /Applications/XAMPP/xamppfiles/lib/php/pear/PEAR/config.php on line 650
Deprecated: Assigning the return value of new by reference is deprecated in /Applications/XAMPP/xamppfiles/lib/php/pear/PEAR/config.php on line 697
Deprecated: Assigning the return value of new by reference is deprecated in /Applications/XAMPP/xamppfiles/lib/php/pear/PEAR/config.php on line 757
Deprecated: Assigning the return value of new by reference is deprecated in /Applications/XAMPP/xamppfiles/lib/php/pear/PEAR/config.php on line 786
.
.
Fatal error: Cannot redeclare class PEAR_Config in /Applications/XAMPP/xamppfiles/lib/php/pear/PEAR/config.php on line 254
-----------------------------------------------------

Any ideas ?????
JahnHauser
 
Posts: 7
Joined: 12. July 2010 18:01

Re: how to install the Pear db.php package ?

Postby MegaChriz » 17. July 2010 15:40

Hm, it looks like the package was originally written for PHP 4 and not fully compatible with PHP 5.3.

The 'deprecated'-error means a language construct is used which is deprecated in PHP 5.3 (but it was probably needed for PHP 4).
Code: Select all
&new PEAR_Registry

The 'deprecated'-error is not a fatal error, but a sort of warning that the used language construct will be removed in the next major PHP version (probably PHP 6). You can hide these messages by setting the error reporting.
To turn off deprecated warnings at PHP script level, type for example
Code: Select all
error_reporting(E_ALL ^ E_DEPRECATED);
to hide deprecated errors, but show most others. Type those lines before including PEAR code, if possible. If it is not possible, you can also choose to set the error reporting in the php.ini:
Code: Select all
error_reporting  =  E_ALL & ~E_DEPRECATED
http://php.net/manual/en/function.error-reporting.php (function)
http://php.net/error_reporting (php.ini)

The second error can mean two things:
- A file (which contains the PEAR_Config class) got included twice.
- There are two files included which both got a PEAR_Config class.

I'm not sure what's the best way to fix this.
If it's the case that there are two PEAR_Config classes, you could try to comment out one of them, but it's possible that this will lead to unexpected results. If it's the case that the config-file got included twice, you should look up the places where the config-file got included and change the code from 'include' to 'include_once' or from 'require' to 'require_once'.
http://php.net/include_once
http://php.net/require_once

I'm not sure if you can fix it the way I described above. I thought it was the case that PEAR would be dynamically loaded before your own PHP-scripts gets loaded, but since I never have done anything with PEAR yet, I don't know if that is the case.

If you can't get the errors fixed, I think you should ask the PEAR-community for help.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X

Re: how to install the Pear db.php package ?

Postby JahnHauser » 18. July 2010 20:07

Hi MegaChriz,

I'm using everywhere require_once....

Still trying to get rid off the 'deprecated...' error without success so far :(

On Windows I use still XAMPP Version 1.6.3a. Does anybody know if there is an equivalent MAC version around?
JahnHauser
 
Posts: 7
Joined: 12. July 2010 18:01

Re: how to install the Pear db.php package ?

Postby MegaChriz » 19. July 2010 11:03

If you want to go back to PHP 5.2.x, then use XAMPP for Mac 1.0.1, that was the last XAMPP-version with PHP 5.2.x (it had PHP 5.2.9). You won't see deprecated-errors there, because those were introduced in PHP 5.3.
If you still want to use PHP 4 (not recommended, because that PHP-version isn't supported anymore), then you should go for XAMPP for Mac 0.7.4. That XAMPP version had both PHP 4 and PHP 5 on board (I believe it was PHP 5.2.6 together with PHP 4.4.3)

I don't know which PHP-versions came with XAMPP Version 1.6.3a (but probably both PHP 4 and PHP 5), so you need to figure out yourself which PHP-version fits you best.
MegaChriz
 
Posts: 158
Joined: 16. February 2009 15:04
Location: Amersfoort, The Netherlands
Operating System: Mac OS X


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 9 guests