installing PEAR on windows XP with php 5.2.x


I had some rough time getting pear run on windows when it was such an easy task ๐Ÿ™‚

Pear comes bundles with php 5.2.x and while installing php make sure that you customize the install to include pear and if you are installing any extensions you have the correct path setup for their libs otherwise you will get dll errors when you run php from command prompt. e.g in my install I selected all extensions however most of the extensions depended on other software on your machine and its lib’s to be included in the path, so unless you are going to use it don’t include it ๐Ÿ™‚

Once php gets installed go to the php install folder which by default is at c:\program files\php (although I installed it at c:\php5 ) and run the command go-pear, this will ask you a set of questions, I accepted the default values which installed pear on my system. the pear executable is placed in the same folder as php.

Once pear was installed I also ran the registry file created by pear install to setup environment variables.

Once done I installed my required packages by using the command

pear install <package name>

the list of packages can be found at http://pear.php.net/packages.php

the name will be the name of individual package, e.g HTML_Form

pear install HTML_Form

this will download the package from the online repository and install it on your machine.

You might have to restart the web server to get it running.

That is it, if you have any questions then please do comment on this post or email me at imran@tb2.net

Happy coding ๐Ÿ™‚

Advertisements

11 thoughts on “installing PEAR on windows XP with php 5.2.x

  1. On windows you need to go to services control panel and restart IIS. the location of services control panel is start -> Programs -> Administrative Tools -> Services. Select IIS Admin services and then restart it.

  2. Hi,

    I installed php5.2, but test pear failed (by run PEAR::setErrorHandling(PEAR_ERROR_DIE);).

    I run go-pear.phar, but looked to change the tests path to the test code. Others the default. But failed.

    May you know what’s wrong?

    Thanks.

    John

  3. Hi,

    got the following error

    C:\PHP>pear.bat
    ‘”C:\PHP\PEAR\”‘ is not recognized as an internal or external command,
    operable program or batch file.

  4. Hi!

    Thanks for this site. I am fairly new to PHP and PEAR and your site was the only one that listed the package installation…

    I am trying to send an email from PHP to myself. I need to use SMTP because I am on XP and don’t have an email server installed. My code is basic:

    <?php
    require_once “Mail.php”;

    $from = “Sandra Sender “;
    $to = “Ramona Recipient “;
    $subject = “Hi!”;
    $body = “Hi,\n\nHow are you?”;

    $host = “mail.example.com”;
    $username = “smtp_username”;
    $password = “smtp_password”;

    $headers = array (‘From’ => $from,
    ‘To’ => $to,
    ‘Subject’ => $subject);
    $smtp = Mail::factory(‘smtp’,
    array (‘host’ => $host,
    ‘auth’ => true,
    ‘username’ => $username,
    ‘password’ => $password));

    $mail = $smtp->send($to, $headers, $body);

    if (PEAR::isError($mail)) {
    echo(“” . $mail->getMessage() . “”);
    } else {
    echo(“Message successfully sent!”);
    }
    ?>

    However, when I run it, I get an HTTP 500 internal error. The problem is the
    “$mail = $smtp->send($to, $headers, $body);” line. As soon as I comment it out, the page displays the message, but obviously does not send the email.

    Any hints on what the problem could be?

    Many thanks,

    Martin

  5. hi,
    i was configured php/mysql/apache. but i got the following errors.
    1. PECL::svn Install the PECL svn extension (and also PECL if you havent already done so). You can install from the command line using the command pecl install svn. Follow the installation instructions from the command line output to install the latest version. Once it is installed add extension=svn.so to /etc/php.d/svn.so and restart Apache.

    2. PEAR::Auth Install the PEAR Auth libary (and PEAR if you havent already done so). Groogle uses this for authenticating logons. You can install from the command line using the command pear install Auth. Once it is installed, restart Apache and try again.

    3. Pear::Text_Diff Install the PEAR Text_Diff extension (and PEAR if you havent already done so). You can install from the command line using the command pear install Text_Diff. Once it is installed, restart Apache and try again.

    please reply me as soon as possible

  6. I need help. I have installed pear via xampp and I need to install pear auth and I have no clue how to accomplish this. I have zero programming skills and all of the tutorials havent been able to help me. I am running xp and apache.

    thank you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s