You are here: Re: PEAR doesn't seem to be working « PHP Programming Language « IT news, forums, messages
Re: PEAR doesn't seem to be working

Posted by Schluppy on 01/25/07 20:47

On Thu, 25 Jan 2007 02:35:52 -0800, Charles wrote:

>> Specifically:http://pear.php.net/manual/en/installation.php
>
> Thanks, this is what I followed yesterday. But it doesn't say in the
> docs if there are PHP files and if they need to be put in a specific
> place.

Generally, each pear package contains a set of php files. By default
they're installed in the pear folder hierarchy. Once installed you have to
ensure that the include_path directive in your php.ini contains that path.
Then you can include the files as per usual.

From the manual:

"include_path string

Specifies a list of directories where the require(), include() and
fopen_with_path() functions look for files. The format is like the
system's PATH environment variable: a list of directories separated
with a colon in Unix or semicolon in Windows.

Example G-1. Unix include_path

include_path=".:/php/includes"

Example G-2. Windows include_path

include_path=".;c:\php\includes"

Using a . in the include path allows for relative includes as it means
the current directory."

http://www.php.net/manual/en/ini.core.php

So, assuming you're on windows and your pear directory is in c:\php\pear,
you'd edit the include_path directive in your php.ini to read:

include_path=".;c:\php\includes;c:\php\pear"

If you're using apache you'll want to restart it for the changes to take
effect.

Now in your scripts, you can include any pear packages you've installed
exactly like the documentation for the package specifies.

--
Schluppy

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация