Скачать и установить PEAR под Windows (вручную)

ЧИТАЙТЕ ПРО АВТОМАТИЧЕСКУЮ УСТАНОВКУ ЗДЕСЬ

Итак - скачаем версию прямо с сайт компании-производителя и установим её.
Сайт PEAR

Далее мы будем исходить из предположения, что установленный php у вас мирно лежит по адресу C:\php

1)Качаем файл из этого раздела.
2) Распаковываем скаченный архив
3) Находим в корне распакованного архива файлы PEAR.php и PEAR5.php и перетаскиваем их в папку PEAR .
4) Если в C:\php на вашем компьютере до начала установки была папка PEAR - удалите её и замените одноимённой папкой (тоже с именем PEAR), о которой мы говорили в предыдущем пункте.
5) пропишем специальный "подключаемый путь" для PEAR - это можно сделать пятью способами , но мы рассмотрим пока что только один из них - а именно добавим буквально одну строчку в php.ini - файл конфигурации php , о котором вы должны уже знать (если устанавливали гипертекстовый препроцессор) -
то есть у вас должно быть в фале несколько строк вроде того =

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
include_path= ".;C:\php\PEAR"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"

те, что начинаются с точки с запятой - это "закомментированные" строки 0 они не оказывают никого влияния на настройки - мы же прописали путь к папе PEAR =

 include_path= ".;C:\php\PEAR"
_______________

теперь PEAR вроде как установлен

7)

Because we're installing PEAR on Windows, we can access and modify php.ini in C:\WINNT. Setting up include path via your .htaccess, or your site specific php.ini is discussed in article How to install PEAR on your shared web host.

2.1 Open php.ini which is at C:\WINNT directory.

2.2 Find the line include_path = ".;C:\php\includes" and comment it out by adding semi-colon ; in its front or remove it completely.

2.3 Add a new line include_path = ".;C:\php\PEAR"

Include path for PEAR

If you have other include paths, you can define them here as well. Just separate each with a semi-colon.
For example. include_path = ".;C:\php\PEAR;C:\geeksengine\inc"

The include path created here will be used by PHP as implicit include path which means PHP will already know where to look for the path. So when use include statement include or require_once in a PHP page, you don't need to specify the path again.

For example, when we add code in a PHP page, it knows that the file is at C:\php\PEAR\Text\Highlighter.php. There is no need to specify C:\php\PEAR because it has been defined in php.ini as the default include path.

2.4 After done, save and close php.ini file.

That's all to it. We have installed PEAR.

Step #3: Test if PEAR has been installed correctly.

The best way to test is actually use a PEAR class to do something. We will use PEAR's text_highlighter class to display colored PHP code on a web page.

3.1 Download PEAR Text_Highlighter package

The file I downloaded was Text_Highlighter-0.7.1.tgz

Download Text Highlighter package

3.2 Unzip the package and rename the folder Text_Highlighter-0.7.1 to Text.

It looks like this after rename:

Rename text highlighter folder

3.3 Copy and paste the folder Text to C:\php\PEAR folder.

This will add the Text Highlighter package to the PEAR code library directory and it's ready to be used.

Text highlighter folder

3.4 Create the style sheet for highlighting code.

Text highlighter sample.css

Find the file sample.css under C:\php\PEAR\Text and copy it over to your localhost directory.

On my machine, it's copied to C:\geeksengine\sample.css

3.5 Create a PHP page and save it as test-pear.php in your localhost.

On my machine, it's at C:\geeksengine\test-pear.php

3.6 Open test-pear.php in your text editor and add the following code. The code displays colored PHP code on a web page.

<?
echo "<link rel='stylesheet' type='text/css' href='sample.css'>";

// Include Highlighter class
require_once("Text/Highlighter.php");

// This is the code we want to display
$code = "<?
// This is a test page for PEAR Text_Highlighter package
\$message = \"Hello, world!\";

echo \$message;
?>";

// What to display - PHP code
$what = "php";

// Define the class
$highlighter =& Text_Highlighter::factory($what);

// Call highlight method to display the code to web browser
echo $highlighter->highlight($code);
?>

3.7 Run test-pear.php page.

Open your web browser and view web page http://localhost/test-pear.php. If you can see the colored PHP code as below, you have successfully installed PEAR base library.

Test code highlighter

To use any other packages in PEAR library, just download and add them to C:\php\PEAR directory. To use PEAR on your website, please refer to How to install PEAR on your shared web host.

_____________________________________________
Источники(читать подробнее)=
http://www.geeksengine.com/article/insta...

_____________________________________________
Ключевые слова и фразы(для поиска)=

как Скачать и установить pear

C:\php\PEAR>ачать и установить PEAR с официального сайта
--------------------------