Http pear php net

User FAQ

How do I install a package when I get the error message «No release with state equal to: ‘stable’ found for ‘Packagename'»?

The package in question does have releases, but none that are stable. There are two solutions.

  1. Set preferred_state to alpha or beta and then install $ pear config-set preferred_state alpha$ pear install Packagename
  2. Find out the stability or version number of the latest release and install it directly. $ pear install Packagename-alpha$ pear install Packagename-1.5.3

Why do I get «No handlers for package.xml version 2.0» when I try to install a package?

You are using a PEAR version lower than 1.4.0.

To install the package, you have to update PEAR via:

$ pear upgrade PEAR

This will install the latest available version of PEAR which is capable of installing packages that have only a package.xml version 2.0.

$ pear upgrade —force http://pear.php.net/get/PEAR-1.3.6.tgz http://pear.php.net/Archive_Tar-1.3.1.tgz http://pear.php.net/get/Console_Getopt-1.2.tgz

$ pear upgrade -a http://pear.php.net/get/PEAR-1.4.3.tgz

$ pear upgrade —force PEAR-1.4.11

$ pear upgrade PEAR

There is no end-user documentation for this package! How am I supposed to know how it works?

Even if not all packages do have end-user documentation in the PEAR manual, nearly all of the packages do include examples. The examples are automatically installed when you install a package via the command line installer and are located in $peardir/docs/$packagename/ .

You can find the example/documentation directory by executing $ pear config-get doc_dir on command line.

I have a question about PEAR. Where should I ask?

  • General questions about the usage of PEAR components should be posted to the mailing list pear-general@lists.php.net.
  • All technical discussions concerning the development of PEAR components should be posted to pear-dev@lists.php.net.
  • Question concerning the website can be sent to pear-webmaster@lists.php.net.

Information on subscribing this mailing lists can be found here.

On all mailing lists mentioned above the language is english and the way you ask questions should always be polite :-).

Does PEAR work on Mac OS X?

All Mac OS X versions up until 10.5 come with PEAR by default. Mac OS X 10.5 (Leopard) users will need to install PEAR using the standard installation instructions.

If you are a OS X 10.4 or lower user, you may wish to upgrade to a newer version of PHP using a binary installable package such as Marc Liyanage’s PHP packages. If you have installed another PHP package, you may have two versions of PHP and PEAR installed on your system. To be sure which version you are using, type which pear in your console to find out where PEAR is located, and pear -V to find out some info about the pear version, and also pear config-show to see the configuration details.

Читайте также:  Java native exception handling

If you have not made any modifications to the default Max OS X install, the PEAR version you are running is the /usr/bin/pear which is configured for the PHP 4 version distributed with OS X. If this is the case, there are a couple options to use a PHP 5 version on your Mac.

If you’re using Marc Liyanage’s PHP package, you can specify the full path to your PHP5 PEAR installation. For example /usr/local/php5/bin/pear install to install a package for your PHP 5 installation (installing/upgrading packages will probably require sudo).

Alternatively, you can change every path for the OS X provided PEAR using pear config-set. Remember to specify all paths necessary to point to your PHP 5 installation.

What I prefer to do, is remove the Apple supplied PHP 4 with sudo rm /usr/bin/php /usr/bin/pear and then symbolically link php and PEAR in /usr/bin to the location where Marc Liyanage’s packages are installed: sudo ln -s /usr/local/php5/bin/php /usr/bin/php && sudo ln -s /usr/local/php5/bin/pear /usr/bin/pear. Keep in mind, Apple occasionally updates PHP on OSX, which will revert your /usr/bin/php to their distributed version. Pay attention to software update, and read the information regarding updated software bundled with OS X updates.

Does PEAR work on windows?

To make PEAR work on Windows, you simple need to add the PEAR installation dir (e.g. c:\php\pear ) to the include_path directive in your php.ini .

Note: There are some classes (like Schedule/At.php), that do not work on Windows, because they use *nix specific commands.

go-pear.php or bundled packages in the windows build of PHP 4.3.x is out of date!

Unlike other aspects of PEAR development, the windows build of PHP 4.3.x is not tracked in SVN. Instead, it is located on the machine that builds windows snapshots. Often, this will not be updated when the rest of PEAR is updated. Note that PHP 5.x releases use a different build system and are automatically updated to the latest versions of PEAR.

If you find that PHP 4.3.x has out-of-date versions of packages, or no longer works, then please report that the windows bundle of PEAR is out of date to pear-dev@lists.php.net

Why does my browser show strange warnings when logging in to the website?

You are seeing the warnings because pear.php.net uses a SSL key that is signed by CAcert, whose root certificate is unfortunately not bundled with most browsers.

If you are using a Mozilla browser, you can import the certificate on this site by clicking on the link » Root Certificate (PEM Format) «. When asked if you want to trust the new Certificate Authority, you need to check at least the » Trust this CA to identify web sites. » box and click «Ok».

People using Internet Explorer may find help here.

Читайте также:  Python multiprocessing lock file

Mac OS X users must download the above mentioned PEM file. The certificate can then be imported with the » Keychain Access » utility via » Import » in the » File » menu.

Installing into customized windows folders fails

To know that the folder has a customized view, Windows sets the «read-only» attribute to the folder. The «read-only» attribute is not actually used to control write access. You can create files in a «read-only» folder. http://support.microsoft.com/default.aspx?scid=kb;en-us;326549

The PEAR Installer detects the read-only attribute and refuses to install into these folders. Unfortunately, there is no way to distinguish between customized folders and actual read-only folders on Windows.

The work-around is to avoid installing PEAR packages into customized Windows folders.

I’ve got an old installation of PEAR and don’t have the permissions to install a new version — what now?

If $ which pear gives you something like /usr/local/bin/pear and $ pear -V shows a very old version or if you don’t want to use it for other reasons, you have to install PEAR in your home directory.

Go to http://pear.php.net/go-pear.phar, save as gopear.phar and do $ php go-pear.phar.

Use /home/user/pear as prefix while installing PEAR, where user is your username.

Once the installation is done, edit your PATH variable to include your planned new PEAR directory before the old one.

For example put a export PATH=/home/user/pear/bin:$PATH at the end of your ~/.bashrc or ~/.profile under Linux. $ echo $PATH should give you now /home/user/pear/bin:[. ]

$ which pear should result in /home/user/pear/bin/pear and $ pear -V something like «PEAR Version: 1.4.8» (at the time of writing) or newer. Check the latest stable version at http://pear.php.net/package/PEAR under Current Release.

Now all you need is to set your include_path correctly, most likely via

$path = ini_get ( ‘include_path’ );
ini_set ( ‘include_path’ , ‘/home/user/pear’ . PATH_SEPARATOR . $path );
?>

I have updated package X to get rid of errors like «undefined function Y», but PHP still shows the error message(s). What’s wrong?

It is very likely that you have defined two PEAR directories in your include_path, and that you have updated the package in the directory that is defined behind the first directory in your include_path. If you either remove the wrong directory from your include_path or change the order of the directories in your include_path, the error messages should not be shown anymore.

The downloaded go-pear.phar isn’t parsed by PHP! Why?

If you have followed the instructions for getting go-pear.phar and you are using e.g. Windows and the Internet Explorer, you might get the strange effect that — although you have named the file go-pear.phar — the file isn’t parsed and the PHP source code of it is shown.

The problem is that e.g. the Internet Explorer saves the file as a HTML file with some HTML code around the PHP source code to display the code nicely.

To avoid this problem, you should use the source code view of your browser, e.g. by clicking with the right mouse key and selecting «Show source code» from the context menu. If you save now the file that is shown in your editor as go-pear.php, PHP will be able to parse the file properly.

Please note that the Windows versions of PHP have a file named go-pear.bat bundled. It is recommended to use this batch file on Windows instead of using go-pear.php.

Читайте также:  Switch case java синтаксис

Источник

What is PEAR?

PEAR is short for » PHP Extension and Application Repository » and is pronounced just like the fruit. The purpose of PEAR is to provide:

  • A structured library of open-source code for PHP users
  • A system for code distribution and package maintenance
  • A standard style for code written in PHP, specified here
  • The PHP Extension Community Library (PECL), see more below
  • A web site, mailing lists and download mirrors to support the PHP/PEAR community

PEAR is a community-driven project governed by its developers. PEAR’s governing bodies are subdivided into the PEAR Group, Collectives, and a President. PEAR’s constitution (adopted in March 2007) defining these groups is documented here. The PEAR project was founded in 1999 by Stig S. Bakken and quite a lot of people have joined the project.

PEAR Mission Statement

PEAR’s mission is to provide reusable components, lead innovation in PHP, provide best practices for PHP development and educate developers.

Structured Libraries and Applications of PHP Code

The code in PEAR is partitioned in » packages «. Each package is a separate project with its own development team, version number, release cycle, documentation and a defined relation to other packages (including dependencies). Packages are distributed as gzipped tar files with a description file inside, and installed on your local system using the PEAR installer.

Packages may relate to each other through explicit dependencies, but there is no automatic dependency relationship between packages based on the package name. For example, » HTTP_Post » is by default independent of » HTTP «. Dependencies between packages with similar names is not forbidden, and does happen. As an example,the » DB_DataObject » package depends on the » DB » package.

A style guide, the PEAR Coding Standards (short PCS), exists to ease collaboration between PEAR developers, to enforce quality, and to enforce a consistent visual appearance of all source code distributed as a PEAR package.

Code Distribution and Package Maintenance

All PEAR packages are registered in and downloaded from a central server at pear.php.net. Other third-party servers called » channels » also distribute packages that can be installed by the PEAR Installer, see the Channels list for more information. pear.php.net does not endorse the packages from these channels, and only provides support for packages distributed from pear.php.net.

Pear.php.net provides both a human-friendly (HTML) and machine-friendly (currently REST ) interface to the packages available from pear.php.net. All communication occurs over the HTTP protocol. Other functions the pear.php.net site provides are:

  • user account management (independent of the SVN server)
  • package management
  • release management

Packages are distributed as a gzipped tar file with an XML description file inside. The description file (package.xml) contains some information about the package, a list of files and their roles, and dependencies.

The PHP Extension Community Library (PECL)

PECL (pronounced » pickle «) is a separate project that distributes PHP extensions (compiled code written in C, such as the PDO extension). PECL extensions are also distributed as packages and can be installed using the PEAR installer with the pecl command.

More information and all PECL packages can now be found on the PECL homepage.

Источник

Оцените статью