This blog is about C++, CakePHP, Linux, PEAR, PHP, Pyrus, Apache, and MySQL and related topics.

Showing posts with label PHP PEAR installation. Show all posts
Showing posts with label PHP PEAR installation. Show all posts

Friday, October 23, 2009

How To Install PEAR With WampServer 2.0i

My last post described how to install PEAR with PHP 5.3.0 on a Windows XP machine.

Here, I will describe how I was able to get PEAR running with WampServer 2.0i

I like WampServer because it is the easiest way to install PHP, MySQL, and Apache on a Windows machine. Just go to the WampServer site, download and install the file. That's it.

Once it is installed if you want to add PEAR. This is what to do:

Note: I used the default folders when installing WampServer so if you want to follow me exactly then use the default folders. Otherwise, make note of your folders and make the necessary adjustments.

1. Go to this page and copy the content and create a file called go-pear.php. Save this file in the following directory: c:\wamp\bin\php\php5.3.0

2. Open the command line. Switch to the php directory (the one that has php.exe in it).

cd c:\wamp\bin\php\php5.3.0

3. Type this command:

pear.php go-pear.php

4. Answer the installation questions. You might see a lot of warnings concerning deprecated methods. This is normal.

5. Update php.ini. This is the key to getting this right. There are two php.ini files. They are:

C:\wamp\bin\php\php5.3.0\php.ini
C:\wamp\bin\apache\Apache2.2.11\bin\php.ini

The phpinfo() page says the loaded configuration file is C:\wamp\bin\apache\Apache2.2.11\bin\php.ini but change I made to c:\wamp\bin\php\php5.3.0\php.ini were reflected on this page. Instead of figuring out which to use I decided to update both.

Do this to both php.ini files:

Open the php.ini file in any text editor. Notepad will do. In the "Paths and Directories" section find this line:;

Windows: "\path1;\path2"

Change the next line to the following:

include_path = ".;c:\wamp\bin\php\php5.3.0\pear"

Be certain to remove the ';' at the beginning of the line if one is present.

Save and close file.

Now it's time to verify if PEAR is properly installed. <--This article will show you how to do that.

How To Install PEAR With PHP 5.3.0 On A Windows machine

When PHP 5.3.1 is finally released we'll be able to use Pyrus to install PEAR and this should be a lot easier than it is now to install PEAR.

You've come to the right place if you are trying to install PEAR on a Windows XP machine to run with PHP 5.3.0 and are getting frustrated because you can't get it to work.

This is how you do it.

Step 1: Download and install PHP . If you will be using Apache webserver then do not choose VC9, choose VC6. Download the installer for V6 86x Thread Safe or V6 86x Non Thread Safe. If you would like to know what the difference between Thread Safe and Non Thread Safe, click here.

Step 2: Download go-pear from http://pear.php.net/go-pear and safe the file as go-pear.php and save in your PHP directory. I used c:\PHP.

Step 3: From the command prompt (Windows > Start > All Programs > Accessories > Command Prompt ), change the directory to the php directory. Note: the prompt is after '>' and the part before '>' is your current directory.

c:\> cd php
c:\php>

Once we are in the correct directory type the following

php go-pear.php

Installation should begin. Just answer the questions and be sure to update the php.ini

PEAR should be working now.

Followers