September 23, 2008

solution for How To include 'PEAR' in cake PHP?

do You have problem with PEAR with CakePhp ?

Are you Getting Error like Blelow ? Then this post is for you!!


<---------------------->
Warning (2): require_once(PayPal/Profile/API.php) [function.require-once]: failed to open stream: No such file or directory [APP\controllers\components\paypal.php, line 13]

Fatal error: require_once() [function.require]: Failed opening required 'PayPal/Profile/API.php' (include_path='C:\xampp\htdocs\paypal;C:\xampp\htdocs\paypal\app\;.;C:\xampp\php\pear\') in C:\xampp\htdocs\paypal\app\controllers\components\paypal.php on line 13

<--------------------------->
Solution:

1) Go to /cake/config/paths.php


2) then search for :
define ('PEAR', VENDORS.'Pear'.DS);


3) change that line to :

define ('PEAR', VENDORS.'Pear'.DS);
if( file_exists(VENDORS.'Pear'))
{
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . PEAR);
}

Thats it ,now refresh your browser, voila!! It is working!!!.


No comments: