cvs: peardoc / manual.xml.in /en/guide/users commandline.xml installation.xml /en/guide/users/installation cli.xml cvs.xml getting.xml
introduction.xml manually.xml pecl.xml shared.xml
| From: | Christian Weiske | Date: | Mon, 31 Mar 2008 07:53:53 +0000 |
| Subject: | cvs: peardoc / manual.xml.in /en/guide/users commandline.xml installation.xml /en/guide/users/installation cli.xml cvs.xml getting.xml introduction.xml manually.xml pecl.xml shared.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-10599@lists.php.net to get a copy of this message | ||
cweiske Mon Mar 31 07:53:53 2008 UTC
Added files:
/peardoc/en/guide/users commandline.xml installation.xml
/peardoc/en/guide/users/installation cli.xml cvs.xml getting.xml
introduction.xml manually.xml
pecl.xml shared.xml
Modified files:
/peardoc manual.xml.in
Log:
Add a new "user guide" section.
Installation documentation has been moved into it.
I also wrote a completly new "command line installer howto" for newbies.
The transferred installation section needs to be cleaned up, since
there is some overlap with the new howto.
I'll do that in this week, but want to commit anyway because
there are other people working on the docs, too.
http://cvs.php.net/viewvc.cgi/peardoc/manual.xml.in?r1=1.51&r2=1.52&diff_format=u Index: peardoc/manual.xml.in diff -u peardoc/manual.xml.in:1.51 peardoc/manual.xml.in:1.52 --- peardoc/manual.xml.in:1.51 Mon Feb 18 20:34:04 2008 +++ peardoc/manual.xml.in Mon Mar 31 07:53:53 2008 @@ -33,7 +33,6 @@ <part id="about-pear"> <title>&AboutPEAR;</title> &chapters.intro; - &chapters.installation; &chapters.support; &chapters.standards; &chapters.pear2cs; @@ -43,6 +42,13 @@ &chapters.group; </part> + <part id="guide-users"> + <title>&UsersGuide;</title> + + &guide.users.installation; + &guide.users.commandline; + </part> + <part id="guide-newmaint"> <title>&NewMaintainersGuide;</title> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/commandline.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/commandline.xml +++ peardoc/en/guide/users/commandline.xml <?xml version="1.0" encoding="UTF-8"?> <chapter id="cli"> <title>Command line installer</title> <sect1 id="beforeyoubegin"> <title>Before you begin</title> <para>Always remember that PEAR has a help command:</para> <screen>$ pear help... list of commands follows .. </screen> <note> <para>Command examples will have a dollar sign $ before each line that is typed. This helps to distinguish input from the output of the PEAR installer.</para> </note> <para>Help for a command is just as easy to get:</para> <screen>$ pear help <command> $ pear help install... help for install follows ..</screen> <sect2> <title>Configuring your PEAR setup</title> <para>PEAR has a number of configuration options that you can change. Getting an overview about them is as easy as issuing a</para> <screen>$ pear config-show</screen> <para>The default settings suffice for novice users, there is rarely a need to change them when getting started.</para> <para>Reading single values is accomplished by using <literal>config-get</literal>. The following command will show you where all the .php files of your installed pear packages reside.</para> <screen>$ pear config-get php_dir /usr/share/pear</screen> <para>Changing a value is as easy as retrieving it:</para> <screen>$ pear config-set preferred_state beta config-set succeeded</screen> </sect2> </sect1> <sect1 id="installing"> <title>Installing packages</title> <para>After getting PEAR working on your machine (see <link linkend="guide.users.installation">Installation</link>) you most likely want to install some packages. This guide shows people new to the PEAR command line installer how to get started.</para> <sect2> <title>Normal installation procedure</title> <para>The general command to install a PEAR package named "foo" is</para> <screen>$ pear install foo</screen> <para>Typing this and pressing return, the package will be downloaded and installed on your computer. It does not matter if you write the package name in lowercase, UPPERCASE or MixedCase - the installer will find the package by lowercasing the name.</para> <para>When a package is already installed, you will get the following message:</para> <screen>$ pear install foo Ignoring installed package pear/foo Nothing to install</screen> <para>This happens even if there is a newer version of the package! The correct command to update to the lastest version is</para> <screen>$ pear update foo upgrade ok: channel://pear.php.net/Foo-1.2.3</screen> <para>If the package already has the lastest version, you will get a message similar to the following:</para> <screen>Ignoring installed package pear/Foo Nothing to upgrade</screen> <para>In the case you deleted some file and really really want to re-install the package, you have two choices:</para> <itemizedlist> <listitem> <para>Uninstall the package, and reinstall it afterwards</para> </listitem> <listitem> <para>Force the installation</para> </listitem> </itemizedlist> <para>Forcing an command should only be done when you absolutely know what you are doing - you might in some circumstances break PEAR otherwise. Forcing something should always be the last option.</para> <screen>$ pear install -f foo $ pear upgrade -f foo</screen> </sect2> <sect2> <title>Unstable alpha/beta packages</title> <para>Now and then, you will get error messages like</para> <screen>Failed to download pear/foo within preferred state "stable", latest release is version 0.1.2, stability "beta", use "channel://pear.php.net/foo-0.1.2" to install Cannot initialize 'channel://pear.php.net/foo', invalid or missing package file Package "channel://pear.php.net/foo" is not valid install failed</screen> <para>Reason for this is that PEAR by default installs stable packages only. When a package is in state <emphasis>devel</emphasis>, <emphasis>alpha</emphasis> or <emphasis>beta</emphasis> it will refuse to install them. You can easily persuade it by adding either the version number or the stability you are willing to accept:</para> <screen>$ pear install Foo-beta $ pear install Foo-alpha</screen> <para>You can also install a specific version, or upgrade to a specific version regardless of the state:</para> <screen>$ pear install Foo-1.2.3 $ pear upgrade Foo-1.2.3</screen> <sect3> <title>Living on the edge</title> <para>If you don't care about stability and don't want to specify the <literal>-alpha</literal> or <literal>-beta</literal> suffix everytime, you can change the global stability config option: </para> <screen>$ pear config-set preferred_state alpha config-set succeeded</screen> <para>You can switch between the following stability states (sorted by stability):</para> <itemizedlist> <listitem> <para>stable</para> </listitem> <listitem> <para>beta</para> </listitem> <listitem> <para>alpha</para> </listitem> <listitem> <para>devel</para> </listitem> </itemizedlist> </sect3> </sect2> <sect2> <title>Dependencies</title> <para>A package often requires other packages to be installed to function correctly. Such a relation is called a dependency. The PEAR installer has full support for dependencies; it can automatically install required and/or optional dependencies if you wish so.</para> <para>If you try to install a package with required dependencies, you will get an error that the installation failed. Looking deeper and actually reading the messages shows you that the package needs dependencies that are not installed on your system:</para> <screen>$ pear install html_page2 Did not download dependencies: pear/HTML_Common, use --alldeps or --onlyreqdeps to download automatically pear/HTML_Page2 requires package "pear/HTML_Common" (version >= 1.2) No valid packages found install failed</screen> <para>You have several choices:</para> <itemizedlist> <listitem> <para>Install dependent packages by hand</para> </listitem> <listitem> <para>Let PEAR automatically install necessary dependencies only</para> </listitem> <listitem> <para>Let PEAR automatically install necessary and optional dependencies</para> </listitem> </itemizedlist> <para>The first method can be a painful and daunting process, because dependent packages itself can have dependencies.</para> <para>Both other methods just require a switch to the install command, either <literal>--onlyreqdeps</literal> (install required dependencies only) or <literal>--alldeps</literal> (install all dependencies).</para> <screen>$ pear install --onlyreqdeps html_page2 WARNING: "pear/HTML_Common" is deprecated in favor of "pear/HTML_Common2" downloading HTML_Page2-0.5.0beta.tgz ... Starting to download HTML_Page2-0.5.0beta.tgz (15,467 bytes).......done: 15,467 bytes downloading HTML_Common-1.2.4.tgz ... Starting to download HTML_Common-1.2.4.tgz (4,519 bytes)....done: 4,519 bytes install ok: channel://pear.php.net/HTML_Common-1.2.4 install ok: channel://pear.php.net/HTML_Page2-0.5.0beta</screen> </sect2> <sect2> <title>Offline installation</title> <para>You can download individual packages for e.g. offline installation on a second machine just as you would install or upgrade a package:</para> <screen>$ pear download Foo</screen> <para>After downloading, you will have a file like <filename>Foo-1.2.3.tgz</filename> if the latest version of <classname>Foo</classname> was <literal>1.2.3</literal>. Installing it is as easy as typing</para> <screen>$ pear install Foo-1.2.3.tgz</screen> </sect2> </sect1> <sect1 id="packageinfo"> <title>Getting information about packages</title> <sect2> <title>Package information</title> <para>If you simply want to get to know the installed version of a package or see its description, issue an <command>info</command> command:</para> <screen>$ pear info PEAR About pear.php.net/PEAR-1.7.1... more info follows ..</screen> </sect2> <sect2> <title>Package files</title> <para>You often don't know which files belong to a certain installed package. <command>list-files</command> is helping you here. It shows you the file's role and its full path:</para> <screen>$ pear list-files log Installed Files For log ======================= Type Install Path doc /usr/share/pear/docs/Log/docs/guide.txt.... php /usr/share/pear/Log/composite.php php /usr/share/pear/Log/console.php.... data /usr/share/pear/data/Log/misc/log.sql test /usr/share/pear/tests/Log/tests/composite.phpt.... php /usr/share/pear/Log.php</screen> </sect2> <sect2> <title>Package examples</title> <para>While we try to document each package in the manual, many packages - with or without a manual entry - come with examples. They have the file role "<literal>doc</literal>" and can be located with <command>list-files</command>, too:</para> <screen>$ pear list-files log | grep ^doc doc /usr/share/pear/docs/Log/docs/guide.txt doc /usr/share/pear/docs/Log/examples/composite.php doc /usr/share/pear/docs/Log/examples/console.php doc /usr/share/pear/docs/Log/examples/display.php doc /usr/share/pear/docs/Log/examples/error_log.php doc /usr/share/pear/docs/Log/examples/file.php doc /usr/share/pear/docs/Log/examples/firebug.php....</screen> </sect2> <sect2> <title>List all packages</title> <para><command>list</command> shows you all installed packages with their version and stability:</para> <screen>$ pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.2 stable Auth 1.5.4 stable Cache 1.5.4 stable Console_Getargs 1.3.4 stable Console_Getopt 1.2.3 stable....</screen> <para>To see all available packages on the channel server, use <command>remote-list</command>:</para> <screen>$ pear remote-list.... output follows ...</screen> <note> <para>This command takes some time if there are many packages on the server</para> </note> </sect2> <sect2> <title>Search remote packages</title> <para>Instead of going to the PEAR website, you can use the pear installer to search for package names.</para> <screen>$ pear search w3c Retrieving data...0%. Matched packages, channel pear.php.net: ======================================= Package Stable/(Latest) Local Services_W3C_CSSValidator 0.1.0 (alpha) An Object Oriented Interface ...</screen> <para>The result list shows name, remote version and stability and the package description.</para> </sect2> </sect1> <sect1 id="channels"> <title>Using channels</title> <remark>FIXME</remark> <sect2> <title>Channels?</title> <remark>FIXME</remark> </sect2> <sect2> <title>Channel discovery</title> <remark>FIXME</remark> </sect2> <sect2> <title>Work with packages on a channel</title> <remark>FIXME</remark> </sect2> <sect2> <title>Password protected channels</title> <remark>FIXME</remark> </sect2> </sect1> </chapter> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation.xml +++ peardoc/en/guide/users/installation.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <chapter id="installation"> <chapterinfo> <author> <firstname>Martin</firstname> <surname>Jansen</surname> </author> <date>2006-11-25</date> </chapterinfo> <title>Installation</title> <simpara> This chapter describes, how to install packages from PEAR. </simpara> &chapters.installation.introduction; &chapters.installation.getting; &chapters.installation.cli; &chapters.installation.shared; &chapters.installation.manually; &chapters.installation.cvs; &chapters.installation.pecl; </chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/cli.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/cli.xml +++ peardoc/en/guide/users/installation/cli.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.cli"> <title>Command line installer</title> <titleabbrev>CLI installer</titleabbrev> <warning id="installation.cli.prerequesite"> <title>Prerequisites</title> <para> The following description requires the latest version of the <link linkend="installation.getting">PEAR package manager</link> to be installed. </para> </warning> <para> The command line installer is the easiest way to install PEAR packages on your system: It connects to the PEAR package server via a simple HTTP connection, loads the package on your system and installs it to the desired location. </para> <sect2> <title>Fully-automatic installation</title> <para> Using the command line installer is pretty straightforward and easy to use. Simply run the following line on your shell: </para> <para> <screen> <userinput> $ pear install <package> </userinput> </screen> </para> <para> <package> has to be replaced with the name of the package you want to install (e.g. HTTP_Upload). </para> <para> If the wanted package has not reached a stable release yet, you can force the installation by adding a "-beta" or "-alpha" suffix, depending on the current state of the package: </para> <para> <screen> <userinput> $ pear install <package>-beta </userinput> </screen> </para> <para> There are also other options to install a beta or alpha package, using the "-f" switch to force the installation, or setting the preferred_state to beta. Any of the following commands will do: </para> <para> <screen> <userinput> $ pear config-set preferred_state beta $ pear install <package> $ pear config-set preferred_state stable </userinput> </screen> </para> <para> <screen> <userinput> $ pear -d preferred_state=beta install <package> </userinput> </screen> </para> <para> <screen> <userinput> $ pear install -f <package> </userinput> </screen> </para> <para> To get a list of the available packages, you can point your browser to the <ulink url="&url.pear.package.browse;">PEAR package browser</ulink> or you can run: </para> <para> <screen> <userinput> $ pear remote-list </userinput> </screen> </para> <para> This command returns a list of all packages that are available in PEAR at the moment. </para> </sect2> <sect2> <title>Semi-automatic installation</title> <para> If you have downloaded a package release from <ulink url=" &url.pear;">&url.pear;</ulink> as a gzipped tar archive, you can also install it locally. To do this, run the following line on your shell: </para> <para> <screen> <userinput> $ pear install <file>.tgz </userinput> </screen> </para> <para> This command will automatically install the package and does not require an online connection. <filename><file>.tgz</filename> has to be replaced with the name of the downloaded file. </para> </sect2> <sect2> <title>Commands and Variables</title> <para> Here's a list of commands available to the pear command line tool. Many of these commands may require root access to the server. </para> <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>Command</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>build</entry> <entry>Build the extension from source</entry> </row> <row> <entry>bundle</entry> <entry> Download and unpack a <ulink url="&url.pecl;">PECL</ulink> extension </entry> </row> <row> <entry>channel-add</entry> <entry>Add a Channel (PEAR 1.4+)</entry> </row> <row> <entry>channel-alias</entry> <entry>Specify an alias to a channel name (PEAR 1.4+)</entry> </row> <row> <entry>channel-delete</entry> <entry>Remove a channel from the list (PEAR 1.4+)</entry> </row> <row> <entry>channel-discover</entry> <entry>Initialize a channel from its server name (PEAR 1.4+)</entry> </row> <row> <entry>channel-info</entry> <entry>Retrieve information on a channel (PEAR 1.4+)</entry> </row> <row> <entry>channel-update</entry> <entry>Update an existing channel (PEAR 1.4+)</entry> </row> <row> <entry>clear-cache</entry> <entry>Clear the XML-RPC cache</entry> </row> <row> <entry>config-create</entry> <entry>Create a default configuration file (PEAR 1.4+)</entry> </row> <row> <entry>config-get</entry> <entry>Echo a specific configuration setting</entry> </row> <row> <entry>config-help</entry> <entry>Show information about a setting</entry> </row> <row> <entry>config-set</entry> <entry>Set a specific configuration setting value</entry> </row> <row> <entry>config-show</entry> <entry>Show all configuration setting values</entry> </row> <row> <entry>convert</entry> <entry>Convert a package.xml 1.0 format to package.xml 2.0 format (PEAR 1.4+)</entry> </row> <row> <entry>cvsdiff</entry> <entry> Execute and display a "<literal>cvs diff -u</literal>" on all files within the package </entry> </row> <row> <entry>cvstag</entry> <entry>Set a CVS release tag</entry> </row> <row> <entry>download</entry> <entry>Download a package but not install it</entry> </row> <row> <entry>download-all</entry> <entry>Downloads every available package</entry> </row> <row> <entry>info</entry> <entry>Display information about a package</entry> </row> <row> <entry>install</entry> <entry>Install a package, will report with success or failure</entry> </row> <row> <entry>list</entry> <entry>List installed packages</entry> </row> <row> <entry>list-all</entry> <entry>List all packages, packaged and/or available</entry> </row> <row> <entry>list-channels</entry> <entry>List available channels (PEAR 1.4+)</entry> </row> <row> <entry>list-files</entry> <entry>List files in an installed package (PEAR 1.4+)</entry> </row> <row> <entry>list-upgrades</entry> <entry>List available upgrades for the installed packages</entry> </row> <row> <entry>login</entry> <entry>Connects and authenticates to the remote PEAR server</entry> </row> <row> <entry>logout</entry> <entry>Logs out from the remote PEAR server</entry> </row> <row> <entry>makerpm</entry> <entry>Builds a RPM spec file from a PEAR package</entry> </row> <row> <entry>package</entry> <entry>Build a package</entry> </row> <row> <entry>package-dependencies</entry> <entry>Show package dependencies</entry> </row> <row> <entry>package-validate</entry> <entry>Validate package consistency</entry> </row> <row> <entry>remote-info</entry> <entry>Information about remote packages</entry> </row> <row> <entry>remote-list</entry> <entry>List remote packages</entry> </row> <row> <entry>run-scripts</entry> <entry>Run post-install scripts bundled with a package (PEAR 1.4+)</entry> </row> <row> <entry>run-tests</entry> <entry>Run regression tests</entry> </row> <row> <entry>search</entry> <entry>Search the remote package database</entry> </row> <row> <entry>shell-test</entry> <entry>Do a shell script test</entry> </row> <row> <entry>sign</entry> <entry>Sign a package distribution file</entry> </row> <row> <entry>uninstall</entry> <entry>Uninstall and remove a package</entry> </row> <row> <entry>update-channels</entry> <entry>Update the channel list (PEAR 1.4+)</entry> </row> <row> <entry>upgrade</entry> <entry> Upgrade a package to the current version (see also: preferred_state) </entry> </row> <row> <entry>upgrade-all</entry> <entry>Upgrade all packages (see also: list-upgrades)</entry> </row> </tbody> </tgroup> </informaltable> </para> <para> And here's a list of available PEAR configuration variables. Use the <literal>config-get</literal>, <literal>config-help</literal>, <literal>config-set</literal>, and <literal>config-show</literal> command options to use these configuration variables. While installing PEAR on the system, PEAR will attempt to replace the default values with values specific to the given server. Adjust accordingly. </para> <para> <informaltable> <tgroup cols="3"> <thead> <row> <entry>Variable Name</entry> <entry>Description</entry> <entry>Default Value</entry> </row> </thead> <tbody> <row> <entry>bin_dir</entry> <entry>Directory where executables are installed</entry> <entry><filename>/usr/bin</filename></entry> </row> <row> <entry>doc_dir</entry> <entry>Directory where documentation is installed</entry> <entry><filename>/usr/lib/php/docs</filename></entry> </row> <row> <entry>ext_dir</entry> <entry>Directory where loadable extensions are installed</entry> <entry><filename>./</filename></entry> </row> <row> <entry>php_dir</entry> <entry> Directory where PHP files are installed (like PEAR files) </entry> <entry><filename>/usr/lib/php</filename></entry> </row> <row> <entry>cache_dir</entry> <entry>PEAR installer cache directory, and used by XMLRPC</entry> <entry><filename>/tmp/pear/cache</filename></entry> </row> <row> <entry>data_dir</entry> <entry>Directory where data files are installed</entry> <entry><filename>/usr/lib/php/data</filename></entry> </row> <row> <entry>php_bin</entry> <entry>The PHP CLI or CGI binary for executing scripts</entry> <entry><filename>/usr/bin/php</filename></entry> </row> <row> <entry>test_dir</entry> <entry>Directory where regression tests are installed</entry> <entry><filename>/usr/lib/php/tests</filename></entry> </row> <row> <entry>cache_ttk</entry> <entry> Number of seconds that the local cache is used, and not updated (Time To Kill) </entry> <entry>3600</entry> </row> <row> <entry>preferred_state</entry> <entry> Preferred package state: stable, beta, alpha, devel, or snapshot </entry> <entry>stable</entry> </row> <row> <entry>umask</entry> <entry> umask used when creating files (Unix-like systems only) </entry> <entry>22</entry> </row> <row> <entry>verbose</entry> <entry>Debug log level: 0-3 where 3 is full debug mode.</entry> <entry>1</entry> </row> <row> <entry>http_proxy</entry> <entry> The optional HTTP proxy address (host:port) used when downloading packages </entry> <entry> </entry> </row> <row> <entry>remote_config</entry> <entry> Remote configuration file, used to mirror a local installation on a remote server through ftp. (PEAR 1.4+) </entry> <entry> </entry> </row> <row> <entry>auto_discover</entry> <entry>Auto-discover new channels from command line or dependencies</entry> <entry>0</entry> </row> <row> <entry>default_channel</entry> <entry>Default channel (PEAR 1.4+)</entry> <entry>pear.php.net (pecl.php.net if using the pecl command)</entry> </row> <row> <entry>preferred_mirror</entry> <entry>Preferred channel mirror (PEAR 1.4+)</entry> <entry>pear.php.net (pecl.php.net if using the pecl command)</entry> </row> <row> <entry>master_server</entry> <entry>PEAR server [deprecated in PEAR 1.4+]</entry> <entry>pear.php.net</entry> </row> <row> <entry>password</entry> <entry>PEAR password (used by maintainers)</entry> <entry> </entry> </row> <row> <entry>sig_bin</entry> <entry>Signature handling program</entry> <entry><filename>/sw/bin/gpg</filename></entry> </row> <row> <entry>sig_keydir</entry> <entry>Signature key directory</entry> <entry><filename>/etc/pearkeys</filename></entry> </row> <row> <entry>sig_keyid</entry> <entry>The key used for signing</entry> <entry> </entry> </row> <row> <entry>sig_type</entry> <entry>Package signature type (only gpg)</entry> <entry>gpg</entry> </row> <row> <entry>username</entry> <entry>PEAR username (used by maintainers)</entry> <entry> </entry> </row> </tbody> </tgroup> </informaltable> </para> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/cvs.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/cvs.xml +++ peardoc/en/guide/users/installation/cvs.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.cvs"> <title>CVS installer</title> <para> This passage will describe how to install the latest development version of a PEAR package from CVS. </para> <para> It is NOT recommended to run a package from CVS in working environments! Because CVS versions are not regular releases, this means: <itemizedlist> <listitem> <simpara>You could get no kind of help from the maintainer or anybody other.</simpara> </listitem> <listitem> <simpara>Versions in CVS may break the upgrade mechanism of the PEAR Installer.</simpara> </listitem> </itemizedlist> </para> <para> You should use a package from CVS only, if: <itemizedlist> <listitem> <simpara>The maintainer recommended it for you.</simpara> </listitem> <listitem> <simpara>You want to help in development of a package.</simpara> </listitem> <listitem> <simpara>You really need a special patch or function, which is not currently released.</simpara> </listitem> </itemizedlist> </para> <para> If you still want to install a package from CVS, you have to do the same steps like a package maintainer creating a new release of a package. If you have problems following the next steps, take a look into the <link linkend="guide-developers">Developers Section</link> of the manual. </para> <orderedlist> <listitem> <para> Get the package files from CVS like described in <ulink url="&url.php.anoncvs;">&url.php.anoncvs;</ulink> </para> <para> The name of the module to checkout is <filename>pear/<packagename></filename>, i.e. <command> cvs -d :pserver:cvsread@cvs.php.net:/repository checkout pear/HTTP_Client</command>. </para> </listitem> <listitem> <para> Check the <filename>package.xml</filename> file, especially the dir and file entries. They must match the existing files and directory structure. If they differ, contact the package maintainer and ask for an update of the <filename>package.xml</filename>. </para> </listitem> <listitem> <para> Create a valid package using the PEAR Installer <command>pear package <path to package.xml></command> </para> </listitem> <listitem> <para> If you have already installed the package: remove it to avoid version conflicts: <command>pear uninstall <package></command> </para> </listitem> <listitem> <para> Install your package archive: <command>pear install <package-file></command> </para> <para> Now, you have a CVS version installed! </para> </listitem> </orderedlist> <para> You should upgrade to an official release of the package as early as possible. Before you install the official release, uninstall the CVS version to avoid version conflicts. </para> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/getting.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/getting.xml +++ peardoc/en/guide/users/installation/getting.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.getting"> <title>Getting the manager</title> <sect2> <title>Unix/Linux/BSD</title> <para> When using PHP >= 4.3.0, the PEAR Package Manager is already installed unless one has used the <filename>./configure</filename> option <literal>--without-pear</literal>. </para> <para> If one uses a version of PHP that is supplied by Unix/Linux/BSD distributors it may be necessary to manually install PEAR. Users should consult the documentation for the respective distribution in this case. </para> <para> For all versions prior to 4.3.0 or if you want to re-install the Package Manager, you can use the following provisional way: <screen> <userinput> $ lynx -source &url.pear.go; | php </userinput> </screen> </para> <note> <para> Some Linux distributions (e.g. Redhat) seem to be using <filename>links</filename> instead of <filename>lynx</filename> as the name for their command line browser. If this is the case for you, you need to change the above line correspondingly. </para> </note> <note> <para> You can also save &url.pear.go; as <filename>go-pear.php</filename> and run it with: <screen> <userinput> php go-pear.php </userinput> </screen> </para> </note> </sect2> <sect2> <title>Windows</title> <para> After you have downloaded and installed PHP, you have to manually execute the batch file located in e.g. <filename>c:\php\go-pear.bat</filename>. The setup will ask you some questions and afterwards the PEAR Package Manager will be installed in the path, which you have specified during installation. Finally you have to add that installation path to your <literal>PATH</literal> environment. Either do this manually (Start > Control Panel > System > Environment) or run (double-click) the newly generated <filename>PEAR_ENV.reg</filename> that's now found in the PHP source directory. After that you can access the PEAR Package Manager by running the command <literal>pear</literal> in a Windows Command Prompt. </para> <para> To update your PEAR installation from go-pear.org, request &url.pear.go; in your browser and save the output to a local file <filename>go-pear.php</filename>. You can then run <screen> <userinput> php go-pear.php </userinput> </screen> in a Windows Command Prompt to start the update process. </para> </sect2> <sect2> <title>PEAR in hosting environments</title> <para> If you are running your site at a web hosting provider with no direct access to the server (via local logins, Telnet or SSH), you can use the PEAR Installer using the Web Frontend. </para> <para> Go to &url.pear.go; and save as <filename>go-pear.php</filename>. Copy <filename>go-pear.php</filename> to your server and open the corresponding URL in your browser, for example http://example.com/pear/go-pear.php. </para> <warning id="installation.web.prerequesite"> <title>Prerequisites</title> <para> Do not forget to protect the pear directory if you did not do already before the installation. </para> </warning> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/introduction.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/introduction.xml +++ peardoc/en/guide/users/installation/introduction.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.introduction"> <title>Introduction</title> <para> This chapter requires that you are already familiar with the <link linkend="about.pear">general structure</link> of PEAR. </para> <para> The base installation that comes with the PHP distribution, contains all the stuff that is needed to run the PEAR installation tools etc. If you have a recent installation of PHP, you can relax: The PEAR base installation is already there, unless you have compiled your PHP with the <filename>./configure</filename> flag <literal>--without-pear</literal>. </para> <para> The packages that do not come with PHP can be installed with the PEAR package manager. The manager handles installation similar to Debian's <quote><ulink url="&url.debian.apt;">apt-get</ulink></quote> package management utility, as well as others such as <quote>yum</quote>. Again: If you are running a recent version of PHP (> 4.3.0) you can skip the next section. But if you are running PHP 4.2.* or earlier, you need to manually install the manager. </para> <para> Apart from installing packages, the PEAR package manager also handles some other tasks: It can create new packages on your machine, manage a registry of installed packages, check dependencies and it can interact with an <ulink url="&url.xmlrpc;">XML-RPC</ulink> service on pear.php.net to serve some other tasks. </para> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/manually.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/manually.xml +++ peardoc/en/guide/users/installation/manually.xml <?xml version="1.0" encoding="UTF-8"?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.manually"> <title>Manual installation</title> <warning> <para> We removed this section, because, today, manually installing a package requires a deeper understanding of the way how packages are organized and what happens during the installation process. You should read the section about the <filename>package.xml</filename> in the Developers Guide (<xref linkend="developers.packagedef"/> and <xref linkend="guide.developers.package2"/>), if you really want install a package without the PEAR installer. </para> <para> If you want to install PEAR on a remote host without shell access, you should look into <xref linkend="installation.shared"/>. </para> </warning> </sect1> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/pecl.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/pecl.xml +++ peardoc/en/guide/users/installation/pecl.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.pecl"> <title>Installing PECL packages</title> <para> The procedure of installing PECL packages is described in <ulink url="&url.php.manual;en/install.pecl.php">the manual</ulink> on the PHP website. </para> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/shared.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/shared.xml +++ peardoc/en/guide/users/installation/shared.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.shared"> <title>Installation of a local PEAR copy on a shared host</title> <para> Many users have a shared provider that grants access to a system-wide PEAR installation. However, in many cases, it is advantageous to have a local copy of PEAR that can be used for packages that are not installed by the host provider. There are ways of installing PEAR both for users with a telnet/ssh shell access and users who only have ftp access. </para> <sect2 id="installation.shared.shell"> <title>Installing a local copy of PEAR through SSH</title> <para> To install PEAR through SSH, you can use this command sequence to set up a local copy of PEAR: </para> <para> PEAR 1.3.5 and earlier <screen> <userinput> $ pear -s -c ~/.pearrc -d doc_dir=~/pear/docs \ -d ext_dir=~/pear/ext -d php_dir=~/pear/lib \ -d data_dir=~/pear/data -d test_dir=~/pear/tests \ -d cache_dir=~/pear/cache -d bin_dir=~/pear/bin </userinput> </screen> </para> <para> PEAR 1.4+ <screen> <userinput> $ pear config-create /home/user/pear .pearrc </userinput> </screen> </para> <para> This will create a local configuration file in a file in your home directory named <filename>.pearrc</filename>. </para> <para> Then, if you add ~/pear/bin to your path as the first entry in .bashrc (or whatever your startup file is), and run the command: </para> <para> PEAR 1.3.2 and older <screen> <userinput> $ pear -c ~/.pearrc install Archive_Tar PEAR Console_Getopt XML_RPC </userinput> </screen> </para> <para> PEAR 1.3.3+ <screen> <userinput> $ pear install -o PEAR </userinput> </screen> </para> <para> This will create a directory structure based on a subdirectory of your home directory named <filename>pear</filename> that contains all of the packages that you install. You will have a local version of PEAR that supersedes the system's copy. To use the files you have installed, you should set your PHP include_path in either the code that uses your PEAR packages like so: </para> <para> <programlisting role="php"> <![CDATA[ <?php ini_set('include_path', '~/pear/lib' . PATH_SEPARATOR . ini_get('include_path')); // From PHP 4.3.0 onward, you can use the following, // which especially useful on shared hosts: set_include_path('~/pear/lib' . PATH_SEPARATOR . get_include_path()); ?> ]]> </programlisting> </para> <para> Or, in an .htaccess file for apache using php_value. </para> </sect2> <sect2 id="installation.shared.ftp"> <title>Installing a local copy of PEAR through ftp/ftps/sftp</title> <para> There are two ways to install a local copy of PEAR through ftp: the old, difficult way, and the new, easy way. The new, easy way requires an upgrade to version 1.4.3 or newer of PEAR. </para> <sect3> <title>New improved method using PEAR 1.4.3+ and PEAR_RemoteInstaller</title> <para> Installing a local copy of PEAR through ftp has become a piece of cake in PEAR 1.4.3+. </para> <para> One of the banes of many user's existence is trying to install PEAR on a remote host that does not have shell access. Often, the only choice is to use FTP, but even this is a problem for more complex packages that take advantage of installer features like replacements. </para> <para> Here is the sequence necessary to get things running: </para> <para> <orderedlist> <listitem> <para> Make sure you are running PHP 5.0 or newer on your local computer </para> </listitem> <listitem> <para> If you wish to use ftps, make sure you have enabled the openssl extension on your local computer in php.ini. </para> </listitem> <listitem> <para> If you wish to use sftp, make sure you have enabled the ssh2 extension on your local computer in php.ini. </para> </listitem> <listitem> <para> Make sure you have a working copy of the CLI version of PEAR on your local computer (the "pear" command, not the web interface) </para> </listitem> <listitem> <para> Make sure you have ftp access to the remote host, and write access through ftp. (sftp or ftps is <emphasis>highly</emphasis> recommended for security reasons). </para> </listitem> <listitem> <para> Note the full path to your home directory </para> </listitem> <listitem> <para> Create a customized configuration file for both the local and remote host </para> </listitem> <listitem> <para> Upload the remote configuration file to the remote host </para> </listitem> <listitem> <para> Using the local configuration file, set the remote_config value to the location of the configuration file on the remote host </para> </listitem> <listitem> <para> Manage packages at will using the remote-install, remote-uninstall, remote-upgrade and remote-upgrade-all commands. </para> </listitem> </orderedlist> </para> <para> <emphasis> 1. Make sure you have a working copy of the CLI version of PEAR (the "pear" command, not the web interface) </emphasis> </para> <para> Read <link linkend="installation.cli">The installation instructions.</link> </para> <para> <emphasis> 2. Install package PEAR_RemoteInstaller locally if not already done. </emphasis> </para> <para> <emphasis> 3. Make sure you have ftp access to the remote host, and write access through ftp </emphasis> </para> <para> This is pretty straightforward - if you can login using the ftp command in a DOS prompt or from a unix shell, you have ftp access. </para> <para> Write down the user and password that you need to login. </para> <para> Testing write access is easy. If you can upload a file, you have write access. </para> <para> <emphasis> 4. Note the full path to your home directory </emphasis> </para> <para> This is also pretty straightforward. Upload this script to the root directory of your web host to find out: </para> <para> <programlisting> <![CDATA[ <?php echo dirname(__FILE__); ?> ]]> </programlisting> </para> <para> Chances are, it will be something like: <filename>/home/username/htdocs</filename> or <filename>/home/username/public_html</filename>. When you log into ftp, if you can change directory to /home/username, that's great. </para> <para> <emphasis> 5. create a customized config file for both the local and the remote host </emphasis> </para> <para> This is also quite simple. Here is how to do this on windows and unix. </para> <para> Windows first: </para> <para> Pick a location to store your local copy of the remote code. For example, <filename>C:\remote\pear</filename>. From a Command prompt (click Start here => Programs and search for the Command Prompt), type: </para> <para> <screen> <![CDATA[ C:\> mkdir remote C:\> cd remote C:\remote\> mkdir pear C:\remote\> cd pear C:\remote\pear> pear config-create -w C:\remote\pear remote.ini C:\remote\pear> pear config-create /home/username/pear .pearrc ]]> </screen> </para> <para> In Unix, follow a similar process: </para> <para> <screen> <![CDATA[ $ cd $ mkdir remote $ cd remote $ mkdir pear $ cd pear $ pear config-create /home/mylocaluser remote.conf $ pear config-create /home/username/pear .pearrc ]]> </screen> </para> <para> <emphasis> 6. upload the remote configuration file to the remote host </emphasis> </para> <para> This is straightforward - in both operating systems, use ftp to upload <filename>.pearrc</filename> to <filename>/home/username/pear/.pearrc</filename> </para> <para> <emphasis> 7. using the local configuration file, set the remote_config value to the location of the configuration file on the remote host </emphasis> </para> <para> If you wish to use unencrypted ftp (remember: this is inherently insecure), then use <literal>ftp://</literal> as your stream. If you wish to use ftps, then use <literal>ftps://</literal> as your stream. If you wish to use sftp, then use <literal>ssh2.sftp</literal> as your stream. </para> <para> The path you use for the <literal>remote_config</literal> variable may need to be a full pathname, as in: </para> <para> <screen> <![CDATA[ ssh2.sftp://user:pass@myremotehost.com/home/username/.pearrc ]]> </screen> </para> <para> If the initial connection attempt fails, try a relative path as in: </para> <para> <screen> <![CDATA[ ftps://user:pass@myremotehost.com/.pearrc ]]> </screen> </para> <para> To set the value of the <literal>remote_config</literal> configuration variable, use this syntax: </para> <para> In windows: </para> <para> <screen> <![CDATA[ C:\remote\pear\> pear -c remote.ini config-set remote_config \ ftp://user:pass@myremotehost.com/.pearrc ]]> </screen> </para> <para> In Unix: </para> <para> <screen> <![CDATA[ $ pear -c remote.conf config-set remote_config \ ftp://user:pass@myremotehost.com/.pearrc ]]> </screen> </para> <para> <emphasis> 8. Manage packages at will using the remote-install, remote-uninstall, remote-upgrade and remote-upgrade-all commands. </emphasis> </para> <para> From this point on, you can synchronize the local and the remote repositories. </para> <para> <emphasis> How does it work? </emphasis> </para> <para> The installer installs the package locally, and then uses ftp streams and uploads a copy of each locally installed file to its equivalent location remotely. All commands that affect installation (install, uninstall, upgrade, and upgrade-all) have corresponding remote- commands (remote-install, remote-uninstall, remote-upgrade, remote-upgrade-all). The "remote_config" option tells the installer how to retrieve the remote configuration file containing absolute paths where packages should be installed. </para> <para> The remote configuration file is used for any special tasks such as replacements. In other words, if a file expects to get the path to data files through the data_dir configuration directive, then it will have the path on the remote host (<filename>/home/username/pear/data</filename>) rather than the local copy ( <filename>C:\remote\pear\data</filename>). Note that packages installed this way will not work on the local machine, and should be thought of as a backup copy. In an emergency, you can always just upload the entire contents to the remote host using ftp or scp. </para> <para> It is important to note that some packages install themselves differently on windows and on unix. Be sure you know whether this is the case before installing, or ensure that your local and remote systems are the same kind of operating system. In addition, your local packages may depend on PHP extensions. To ensure these are available on the remote server, use the output of phpinfo(); to determine which extensions are available. </para> </sect3> <sect3> <title>The traditional way of installing a local copy of PEAR through ftp</title> <para> In order to install a local copy of PEAR through ftp, you must have an ftp client that can set permissions on upload. First, create a directory that is NOT in your publicly accessible web space, and name it anything you'd like. Set it to be readable and writable by any user (permissions 0777). Then, download a copy of &url.pear.go; and save it as go-pear.php. Upload go-pear.php to a subdirectory of your publicly accessible web space. It is a very good idea to password-protect the directory containing go-pear.php with an .htaccess file. </para> <para> Next, browse to the go-pear.php file. If your web address is &url.example.http;, you have placed go-pear.php in public_html/install/go-pear.php, and &url.example.http; will browse to public_html/, then browse to &url.example.http;install/go-pear.php. Follow the installation prompts. When asked where to install PEAR, choose the directory you created to be readable and writable by any user. You will need to know the location of the cli version of PHP. To find this, browse to this script and copy the output: </para> <para> <programlisting role="php"> <![CDATA[ <?php echo `which php`; // if this does not work, also try echo PHP_BIN; ?> ]]> </programlisting> </para> <para> After PEAR has been installed, you can use the web installer to install and upgrade packages just as you would with any other PEAR installation. To use the files, you must set the include path in scripts on the website. </para> <para> <programlisting role="php"> <![CDATA[ <?php ini_set('include_path', '~/pear/lib' . PATH_SEPARATOR . ini_get('include_path')); // From PHP 4.3.0 onward, you can use the following, // which especially useful on shared hosts: set_include_path('~/pear/lib' . PATH_SEPARATOR . get_include_path()); ?> ]]> </programlisting> </para> </sect3> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewvc.cgi/peardoc/manual.xml.in?r1=1.51&r2=1.52&diff_format=u Index: peardoc/manual.xml.in diff -u peardoc/manual.xml.in:1.51 peardoc/manual.xml.in:1.52 --- peardoc/manual.xml.in:1.51 Mon Feb 18 20:34:04 2008 +++ peardoc/manual.xml.in Mon Mar 31 07:53:53 2008 @@ -33,7 +33,6 @@ <part id="about-pear"> <title>&AboutPEAR;</title> &chapters.intro; - &chapters.installation; &chapters.support; &chapters.standards; &chapters.pear2cs; @@ -43,6 +42,13 @@ &chapters.group; </part> + <part id="guide-users"> + <title>&UsersGuide;</title> + + &guide.users.installation; + &guide.users.commandline; + </part> + <part id="guide-newmaint"> <title>&NewMaintainersGuide;</title> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/commandline.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/commandline.xml +++ peardoc/en/guide/users/commandline.xml <?xml version="1.0" encoding="UTF-8"?> <chapter id="cli"> <title>Command line installer</title> <sect1 id="beforeyoubegin"> <title>Before you begin</title> <para>Always remember that PEAR has a help command:</para> <screen>$ pear help... list of commands follows .. </screen> <note> <para>Command examples will have a dollar sign $ before each line that is typed. This helps to distinguish input from the output of the PEAR installer.</para> </note> <para>Help for a command is just as easy to get:</para> <screen>$ pear help <command> $ pear help install... help for install follows ..</screen> <sect2> <title>Configuring your PEAR setup</title> <para>PEAR has a number of configuration options that you can change. Getting an overview about them is as easy as issuing a</para> <screen>$ pear config-show</screen> <para>The default settings suffice for novice users, there is rarely a need to change them when getting started.</para> <para>Reading single values is accomplished by using <literal>config-get</literal>. The following command will show you where all the .php files of your installed pear packages reside.</para> <screen>$ pear config-get php_dir /usr/share/pear</screen> <para>Changing a value is as easy as retrieving it:</para> <screen>$ pear config-set preferred_state beta config-set succeeded</screen> </sect2> </sect1> <sect1 id="installing"> <title>Installing packages</title> <para>After getting PEAR working on your machine (see <link linkend="guide.users.installation">Installation</link>) you most likely want to install some packages. This guide shows people new to the PEAR command line installer how to get started.</para> <sect2> <title>Normal installation procedure</title> <para>The general command to install a PEAR package named "foo" is</para> <screen>$ pear install foo</screen> <para>Typing this and pressing return, the package will be downloaded and installed on your computer. It does not matter if you write the package name in lowercase, UPPERCASE or MixedCase - the installer will find the package by lowercasing the name.</para> <para>When a package is already installed, you will get the following message:</para> <screen>$ pear install foo Ignoring installed package pear/foo Nothing to install</screen> <para>This happens even if there is a newer version of the package! The correct command to update to the lastest version is</para> <screen>$ pear update foo upgrade ok: channel://pear.php.net/Foo-1.2.3</screen> <para>If the package already has the lastest version, you will get a message similar to the following:</para> <screen>Ignoring installed package pear/Foo Nothing to upgrade</screen> <para>In the case you deleted some file and really really want to re-install the package, you have two choices:</para> <itemizedlist> <listitem> <para>Uninstall the package, and reinstall it afterwards</para> </listitem> <listitem> <para>Force the installation</para> </listitem> </itemizedlist> <para>Forcing an command should only be done when you absolutely know what you are doing - you might in some circumstances break PEAR otherwise. Forcing something should always be the last option.</para> <screen>$ pear install -f foo $ pear upgrade -f foo</screen> </sect2> <sect2> <title>Unstable alpha/beta packages</title> <para>Now and then, you will get error messages like</para> <screen>Failed to download pear/foo within preferred state "stable", latest release is version 0.1.2, stability "beta", use "channel://pear.php.net/foo-0.1.2" to install Cannot initialize 'channel://pear.php.net/foo', invalid or missing package file Package "channel://pear.php.net/foo" is not valid install failed</screen> <para>Reason for this is that PEAR by default installs stable packages only. When a package is in state <emphasis>devel</emphasis>, <emphasis>alpha</emphasis> or <emphasis>beta</emphasis> it will refuse to install them. You can easily persuade it by adding either the version number or the stability you are willing to accept:</para> <screen>$ pear install Foo-beta $ pear install Foo-alpha</screen> <para>You can also install a specific version, or upgrade to a specific version regardless of the state:</para> <screen>$ pear install Foo-1.2.3 $ pear upgrade Foo-1.2.3</screen> <sect3> <title>Living on the edge</title> <para>If you don't care about stability and don't want to specify the <literal>-alpha</literal> or <literal>-beta</literal> suffix everytime, you can change the global stability config option: </para> <screen>$ pear config-set preferred_state alpha config-set succeeded</screen> <para>You can switch between the following stability states (sorted by stability):</para> <itemizedlist> <listitem> <para>stable</para> </listitem> <listitem> <para>beta</para> </listitem> <listitem> <para>alpha</para> </listitem> <listitem> <para>devel</para> </listitem> </itemizedlist> </sect3> </sect2> <sect2> <title>Dependencies</title> <para>A package often requires other packages to be installed to function correctly. Such a relation is called a dependency. The PEAR installer has full support for dependencies; it can automatically install required and/or optional dependencies if you wish so.</para> <para>If you try to install a package with required dependencies, you will get an error that the installation failed. Looking deeper and actually reading the messages shows you that the package needs dependencies that are not installed on your system:</para> <screen>$ pear install html_page2 Did not download dependencies: pear/HTML_Common, use --alldeps or --onlyreqdeps to download automatically pear/HTML_Page2 requires package "pear/HTML_Common" (version >= 1.2) No valid packages found install failed</screen> <para>You have several choices:</para> <itemizedlist> <listitem> <para>Install dependent packages by hand</para> </listitem> <listitem> <para>Let PEAR automatically install necessary dependencies only</para> </listitem> <listitem> <para>Let PEAR automatically install necessary and optional dependencies</para> </listitem> </itemizedlist> <para>The first method can be a painful and daunting process, because dependent packages itself can have dependencies.</para> <para>Both other methods just require a switch to the install command, either <literal>--onlyreqdeps</literal> (install required dependencies only) or <literal>--alldeps</literal> (install all dependencies).</para> <screen>$ pear install --onlyreqdeps html_page2 WARNING: "pear/HTML_Common" is deprecated in favor of "pear/HTML_Common2" downloading HTML_Page2-0.5.0beta.tgz ... Starting to download HTML_Page2-0.5.0beta.tgz (15,467 bytes).......done: 15,467 bytes downloading HTML_Common-1.2.4.tgz ... Starting to download HTML_Common-1.2.4.tgz (4,519 bytes)....done: 4,519 bytes install ok: channel://pear.php.net/HTML_Common-1.2.4 install ok: channel://pear.php.net/HTML_Page2-0.5.0beta</screen> </sect2> <sect2> <title>Offline installation</title> <para>You can download individual packages for e.g. offline installation on a second machine just as you would install or upgrade a package:</para> <screen>$ pear download Foo</screen> <para>After downloading, you will have a file like <filename>Foo-1.2.3.tgz</filename> if the latest version of <classname>Foo</classname> was <literal>1.2.3</literal>. Installing it is as easy as typing</para> <screen>$ pear install Foo-1.2.3.tgz</screen> </sect2> </sect1> <sect1 id="packageinfo"> <title>Getting information about packages</title> <sect2> <title>Package information</title> <para>If you simply want to get to know the installed version of a package or see its description, issue an <command>info</command> command:</para> <screen>$ pear info PEAR About pear.php.net/PEAR-1.7.1... more info follows ..</screen> </sect2> <sect2> <title>Package files</title> <para>You often don't know which files belong to a certain installed package. <command>list-files</command> is helping you here. It shows you the file's role and its full path:</para> <screen>$ pear list-files log Installed Files For log ======================= Type Install Path doc /usr/share/pear/docs/Log/docs/guide.txt.... php /usr/share/pear/Log/composite.php php /usr/share/pear/Log/console.php.... data /usr/share/pear/data/Log/misc/log.sql test /usr/share/pear/tests/Log/tests/composite.phpt.... php /usr/share/pear/Log.php</screen> </sect2> <sect2> <title>Package examples</title> <para>While we try to document each package in the manual, many packages - with or without a manual entry - come with examples. They have the file role "<literal>doc</literal>" and can be located with <command>list-files</command>, too:</para> <screen>$ pear list-files log | grep ^doc doc /usr/share/pear/docs/Log/docs/guide.txt doc /usr/share/pear/docs/Log/examples/composite.php doc /usr/share/pear/docs/Log/examples/console.php doc /usr/share/pear/docs/Log/examples/display.php doc /usr/share/pear/docs/Log/examples/error_log.php doc /usr/share/pear/docs/Log/examples/file.php doc /usr/share/pear/docs/Log/examples/firebug.php....</screen> </sect2> <sect2> <title>List all packages</title> <para><command>list</command> shows you all installed packages with their version and stability:</para> <screen>$ pear list Installed packages, channel pear.php.net: ========================================= Package Version State Archive_Tar 1.3.2 stable Auth 1.5.4 stable Cache 1.5.4 stable Console_Getargs 1.3.4 stable Console_Getopt 1.2.3 stable....</screen> <para>To see all available packages on the channel server, use <command>remote-list</command>:</para> <screen>$ pear remote-list.... output follows ...</screen> <note> <para>This command takes some time if there are many packages on the server</para> </note> </sect2> <sect2> <title>Search remote packages</title> <para>Instead of going to the PEAR website, you can use the pear installer to search for package names.</para> <screen>$ pear search w3c Retrieving data...0%. Matched packages, channel pear.php.net: ======================================= Package Stable/(Latest) Local Services_W3C_CSSValidator 0.1.0 (alpha) An Object Oriented Interface ...</screen> <para>The result list shows name, remote version and stability and the package description.</para> </sect2> </sect1> <sect1 id="channels"> <title>Using channels</title> <remark>FIXME</remark> <sect2> <title>Channels?</title> <remark>FIXME</remark> </sect2> <sect2> <title>Channel discovery</title> <remark>FIXME</remark> </sect2> <sect2> <title>Work with packages on a channel</title> <remark>FIXME</remark> </sect2> <sect2> <title>Password protected channels</title> <remark>FIXME</remark> </sect2> </sect1> </chapter> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation.xml +++ peardoc/en/guide/users/installation.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <chapter id="installation"> <chapterinfo> <author> <firstname>Martin</firstname> <surname>Jansen</surname> </author> <date>2006-11-25</date> </chapterinfo> <title>Installation</title> <simpara> This chapter describes, how to install packages from PEAR. </simpara> &chapters.installation.introduction; &chapters.installation.getting; &chapters.installation.cli; &chapters.installation.shared; &chapters.installation.manually; &chapters.installation.cvs; &chapters.installation.pecl; </chapter> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/cli.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/cli.xml +++ peardoc/en/guide/users/installation/cli.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.cli"> <title>Command line installer</title> <titleabbrev>CLI installer</titleabbrev> <warning id="installation.cli.prerequesite"> <title>Prerequisites</title> <para> The following description requires the latest version of the <link linkend="installation.getting">PEAR package manager</link> to be installed. </para> </warning> <para> The command line installer is the easiest way to install PEAR packages on your system: It connects to the PEAR package server via a simple HTTP connection, loads the package on your system and installs it to the desired location. </para> <sect2> <title>Fully-automatic installation</title> <para> Using the command line installer is pretty straightforward and easy to use. Simply run the following line on your shell: </para> <para> <screen> <userinput> $ pear install <package> </userinput> </screen> </para> <para> <package> has to be replaced with the name of the package you want to install (e.g. HTTP_Upload). </para> <para> If the wanted package has not reached a stable release yet, you can force the installation by adding a "-beta" or "-alpha" suffix, depending on the current state of the package: </para> <para> <screen> <userinput> $ pear install <package>-beta </userinput> </screen> </para> <para> There are also other options to install a beta or alpha package, using the "-f" switch to force the installation, or setting the preferred_state to beta. Any of the following commands will do: </para> <para> <screen> <userinput> $ pear config-set preferred_state beta $ pear install <package> $ pear config-set preferred_state stable </userinput> </screen> </para> <para> <screen> <userinput> $ pear -d preferred_state=beta install <package> </userinput> </screen> </para> <para> <screen> <userinput> $ pear install -f <package> </userinput> </screen> </para> <para> To get a list of the available packages, you can point your browser to the <ulink url="&url.pear.package.browse;">PEAR package browser</ulink> or you can run: </para> <para> <screen> <userinput> $ pear remote-list </userinput> </screen> </para> <para> This command returns a list of all packages that are available in PEAR at the moment. </para> </sect2> <sect2> <title>Semi-automatic installation</title> <para> If you have downloaded a package release from <ulink url=" &url.pear;">&url.pear;</ulink> as a gzipped tar archive, you can also install it locally. To do this, run the following line on your shell: </para> <para> <screen> <userinput> $ pear install <file>.tgz </userinput> </screen> </para> <para> This command will automatically install the package and does not require an online connection. <filename><file>.tgz</filename> has to be replaced with the name of the downloaded file. </para> </sect2> <sect2> <title>Commands and Variables</title> <para> Here's a list of commands available to the pear command line tool. Many of these commands may require root access to the server. </para> <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>Command</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry>build</entry> <entry>Build the extension from source</entry> </row> <row> <entry>bundle</entry> <entry> Download and unpack a <ulink url="&url.pecl;">PECL</ulink> extension </entry> </row> <row> <entry>channel-add</entry> <entry>Add a Channel (PEAR 1.4+)</entry> </row> <row> <entry>channel-alias</entry> <entry>Specify an alias to a channel name (PEAR 1.4+)</entry> </row> <row> <entry>channel-delete</entry> <entry>Remove a channel from the list (PEAR 1.4+)</entry> </row> <row> <entry>channel-discover</entry> <entry>Initialize a channel from its server name (PEAR 1.4+)</entry> </row> <row> <entry>channel-info</entry> <entry>Retrieve information on a channel (PEAR 1.4+)</entry> </row> <row> <entry>channel-update</entry> <entry>Update an existing channel (PEAR 1.4+)</entry> </row> <row> <entry>clear-cache</entry> <entry>Clear the XML-RPC cache</entry> </row> <row> <entry>config-create</entry> <entry>Create a default configuration file (PEAR 1.4+)</entry> </row> <row> <entry>config-get</entry> <entry>Echo a specific configuration setting</entry> </row> <row> <entry>config-help</entry> <entry>Show information about a setting</entry> </row> <row> <entry>config-set</entry> <entry>Set a specific configuration setting value</entry> </row> <row> <entry>config-show</entry> <entry>Show all configuration setting values</entry> </row> <row> <entry>convert</entry> <entry>Convert a package.xml 1.0 format to package.xml 2.0 format (PEAR 1.4+)</entry> </row> <row> <entry>cvsdiff</entry> <entry> Execute and display a "<literal>cvs diff -u</literal>" on all files within the package </entry> </row> <row> <entry>cvstag</entry> <entry>Set a CVS release tag</entry> </row> <row> <entry>download</entry> <entry>Download a package but not install it</entry> </row> <row> <entry>download-all</entry> <entry>Downloads every available package</entry> </row> <row> <entry>info</entry> <entry>Display information about a package</entry> </row> <row> <entry>install</entry> <entry>Install a package, will report with success or failure</entry> </row> <row> <entry>list</entry> <entry>List installed packages</entry> </row> <row> <entry>list-all</entry> <entry>List all packages, packaged and/or available</entry> </row> <row> <entry>list-channels</entry> <entry>List available channels (PEAR 1.4+)</entry> </row> <row> <entry>list-files</entry> <entry>List files in an installed package (PEAR 1.4+)</entry> </row> <row> <entry>list-upgrades</entry> <entry>List available upgrades for the installed packages</entry> </row> <row> <entry>login</entry> <entry>Connects and authenticates to the remote PEAR server</entry> </row> <row> <entry>logout</entry> <entry>Logs out from the remote PEAR server</entry> </row> <row> <entry>makerpm</entry> <entry>Builds a RPM spec file from a PEAR package</entry> </row> <row> <entry>package</entry> <entry>Build a package</entry> </row> <row> <entry>package-dependencies</entry> <entry>Show package dependencies</entry> </row> <row> <entry>package-validate</entry> <entry>Validate package consistency</entry> </row> <row> <entry>remote-info</entry> <entry>Information about remote packages</entry> </row> <row> <entry>remote-list</entry> <entry>List remote packages</entry> </row> <row> <entry>run-scripts</entry> <entry>Run post-install scripts bundled with a package (PEAR 1.4+)</entry> </row> <row> <entry>run-tests</entry> <entry>Run regression tests</entry> </row> <row> <entry>search</entry> <entry>Search the remote package database</entry> </row> <row> <entry>shell-test</entry> <entry>Do a shell script test</entry> </row> <row> <entry>sign</entry> <entry>Sign a package distribution file</entry> </row> <row> <entry>uninstall</entry> <entry>Uninstall and remove a package</entry> </row> <row> <entry>update-channels</entry> <entry>Update the channel list (PEAR 1.4+)</entry> </row> <row> <entry>upgrade</entry> <entry> Upgrade a package to the current version (see also: preferred_state) </entry> </row> <row> <entry>upgrade-all</entry> <entry>Upgrade all packages (see also: list-upgrades)</entry> </row> </tbody> </tgroup> </informaltable> </para> <para> And here's a list of available PEAR configuration variables. Use the <literal>config-get</literal>, <literal>config-help</literal>, <literal>config-set</literal>, and <literal>config-show</literal> command options to use these configuration variables. While installing PEAR on the system, PEAR will attempt to replace the default values with values specific to the given server. Adjust accordingly. </para> <para> <informaltable> <tgroup cols="3"> <thead> <row> <entry>Variable Name</entry> <entry>Description</entry> <entry>Default Value</entry> </row> </thead> <tbody> <row> <entry>bin_dir</entry> <entry>Directory where executables are installed</entry> <entry><filename>/usr/bin</filename></entry> </row> <row> <entry>doc_dir</entry> <entry>Directory where documentation is installed</entry> <entry><filename>/usr/lib/php/docs</filename></entry> </row> <row> <entry>ext_dir</entry> <entry>Directory where loadable extensions are installed</entry> <entry><filename>./</filename></entry> </row> <row> <entry>php_dir</entry> <entry> Directory where PHP files are installed (like PEAR files) </entry> <entry><filename>/usr/lib/php</filename></entry> </row> <row> <entry>cache_dir</entry> <entry>PEAR installer cache directory, and used by XMLRPC</entry> <entry><filename>/tmp/pear/cache</filename></entry> </row> <row> <entry>data_dir</entry> <entry>Directory where data files are installed</entry> <entry><filename>/usr/lib/php/data</filename></entry> </row> <row> <entry>php_bin</entry> <entry>The PHP CLI or CGI binary for executing scripts</entry> <entry><filename>/usr/bin/php</filename></entry> </row> <row> <entry>test_dir</entry> <entry>Directory where regression tests are installed</entry> <entry><filename>/usr/lib/php/tests</filename></entry> </row> <row> <entry>cache_ttk</entry> <entry> Number of seconds that the local cache is used, and not updated (Time To Kill) </entry> <entry>3600</entry> </row> <row> <entry>preferred_state</entry> <entry> Preferred package state: stable, beta, alpha, devel, or snapshot </entry> <entry>stable</entry> </row> <row> <entry>umask</entry> <entry> umask used when creating files (Unix-like systems only) </entry> <entry>22</entry> </row> <row> <entry>verbose</entry> <entry>Debug log level: 0-3 where 3 is full debug mode.</entry> <entry>1</entry> </row> <row> <entry>http_proxy</entry> <entry> The optional HTTP proxy address (host:port) used when downloading packages </entry> <entry> </entry> </row> <row> <entry>remote_config</entry> <entry> Remote configuration file, used to mirror a local installation on a remote server through ftp. (PEAR 1.4+) </entry> <entry> </entry> </row> <row> <entry>auto_discover</entry> <entry>Auto-discover new channels from command line or dependencies</entry> <entry>0</entry> </row> <row> <entry>default_channel</entry> <entry>Default channel (PEAR 1.4+)</entry> <entry>pear.php.net (pecl.php.net if using the pecl command)</entry> </row> <row> <entry>preferred_mirror</entry> <entry>Preferred channel mirror (PEAR 1.4+)</entry> <entry>pear.php.net (pecl.php.net if using the pecl command)</entry> </row> <row> <entry>master_server</entry> <entry>PEAR server [deprecated in PEAR 1.4+]</entry> <entry>pear.php.net</entry> </row> <row> <entry>password</entry> <entry>PEAR password (used by maintainers)</entry> <entry> </entry> </row> <row> <entry>sig_bin</entry> <entry>Signature handling program</entry> <entry><filename>/sw/bin/gpg</filename></entry> </row> <row> <entry>sig_keydir</entry> <entry>Signature key directory</entry> <entry><filename>/etc/pearkeys</filename></entry> </row> <row> <entry>sig_keyid</entry> <entry>The key used for signing</entry> <entry> </entry> </row> <row> <entry>sig_type</entry> <entry>Package signature type (only gpg)</entry> <entry>gpg</entry> </row> <row> <entry>username</entry> <entry>PEAR username (used by maintainers)</entry> <entry> </entry> </row> </tbody> </tgroup> </informaltable> </para> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/cvs.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/cvs.xml +++ peardoc/en/guide/users/installation/cvs.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.cvs"> <title>CVS installer</title> <para> This passage will describe how to install the latest development version of a PEAR package from CVS. </para> <para> It is NOT recommended to run a package from CVS in working environments! Because CVS versions are not regular releases, this means: <itemizedlist> <listitem> <simpara>You could get no kind of help from the maintainer or anybody other.</simpara> </listitem> <listitem> <simpara>Versions in CVS may break the upgrade mechanism of the PEAR Installer.</simpara> </listitem> </itemizedlist> </para> <para> You should use a package from CVS only, if: <itemizedlist> <listitem> <simpara>The maintainer recommended it for you.</simpara> </listitem> <listitem> <simpara>You want to help in development of a package.</simpara> </listitem> <listitem> <simpara>You really need a special patch or function, which is not currently released.</simpara> </listitem> </itemizedlist> </para> <para> If you still want to install a package from CVS, you have to do the same steps like a package maintainer creating a new release of a package. If you have problems following the next steps, take a look into the <link linkend="guide-developers">Developers Section</link> of the manual. </para> <orderedlist> <listitem> <para> Get the package files from CVS like described in <ulink url="&url.php.anoncvs;">&url.php.anoncvs;</ulink> </para> <para> The name of the module to checkout is <filename>pear/<packagename></filename>, i.e. <command> cvs -d :pserver:cvsread@cvs.php.net:/repository checkout pear/HTTP_Client</command>. </para> </listitem> <listitem> <para> Check the <filename>package.xml</filename> file, especially the dir and file entries. They must match the existing files and directory structure. If they differ, contact the package maintainer and ask for an update of the <filename>package.xml</filename>. </para> </listitem> <listitem> <para> Create a valid package using the PEAR Installer <command>pear package <path to package.xml></command> </para> </listitem> <listitem> <para> If you have already installed the package: remove it to avoid version conflicts: <command>pear uninstall <package></command> </para> </listitem> <listitem> <para> Install your package archive: <command>pear install <package-file></command> </para> <para> Now, you have a CVS version installed! </para> </listitem> </orderedlist> <para> You should upgrade to an official release of the package as early as possible. Before you install the official release, uninstall the CVS version to avoid version conflicts. </para> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/getting.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/getting.xml +++ peardoc/en/guide/users/installation/getting.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.getting"> <title>Getting the manager</title> <sect2> <title>Unix/Linux/BSD</title> <para> When using PHP >= 4.3.0, the PEAR Package Manager is already installed unless one has used the <filename>./configure</filename> option <literal>--without-pear</literal>. </para> <para> If one uses a version of PHP that is supplied by Unix/Linux/BSD distributors it may be necessary to manually install PEAR. Users should consult the documentation for the respective distribution in this case. </para> <para> For all versions prior to 4.3.0 or if you want to re-install the Package Manager, you can use the following provisional way: <screen> <userinput> $ lynx -source &url.pear.go; | php </userinput> </screen> </para> <note> <para> Some Linux distributions (e.g. Redhat) seem to be using <filename>links</filename> instead of <filename>lynx</filename> as the name for their command line browser. If this is the case for you, you need to change the above line correspondingly. </para> </note> <note> <para> You can also save &url.pear.go; as <filename>go-pear.php</filename> and run it with: <screen> <userinput> php go-pear.php </userinput> </screen> </para> </note> </sect2> <sect2> <title>Windows</title> <para> After you have downloaded and installed PHP, you have to manually execute the batch file located in e.g. <filename>c:\php\go-pear.bat</filename>. The setup will ask you some questions and afterwards the PEAR Package Manager will be installed in the path, which you have specified during installation. Finally you have to add that installation path to your <literal>PATH</literal> environment. Either do this manually (Start > Control Panel > System > Environment) or run (double-click) the newly generated <filename>PEAR_ENV.reg</filename> that's now found in the PHP source directory. After that you can access the PEAR Package Manager by running the command <literal>pear</literal> in a Windows Command Prompt. </para> <para> To update your PEAR installation from go-pear.org, request &url.pear.go; in your browser and save the output to a local file <filename>go-pear.php</filename>. You can then run <screen> <userinput> php go-pear.php </userinput> </screen> in a Windows Command Prompt to start the update process. </para> </sect2> <sect2> <title>PEAR in hosting environments</title> <para> If you are running your site at a web hosting provider with no direct access to the server (via local logins, Telnet or SSH), you can use the PEAR Installer using the Web Frontend. </para> <para> Go to &url.pear.go; and save as <filename>go-pear.php</filename>. Copy <filename>go-pear.php</filename> to your server and open the corresponding URL in your browser, for example http://example.com/pear/go-pear.php. </para> <warning id="installation.web.prerequesite"> <title>Prerequisites</title> <para> Do not forget to protect the pear directory if you did not do already before the installation. </para> </warning> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/introduction.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/introduction.xml +++ peardoc/en/guide/users/installation/introduction.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.introduction"> <title>Introduction</title> <para> This chapter requires that you are already familiar with the <link linkend="about.pear">general structure</link> of PEAR. </para> <para> The base installation that comes with the PHP distribution, contains all the stuff that is needed to run the PEAR installation tools etc. If you have a recent installation of PHP, you can relax: The PEAR base installation is already there, unless you have compiled your PHP with the <filename>./configure</filename> flag <literal>--without-pear</literal>. </para> <para> The packages that do not come with PHP can be installed with the PEAR package manager. The manager handles installation similar to Debian's <quote><ulink url="&url.debian.apt;">apt-get</ulink></quote> package management utility, as well as others such as <quote>yum</quote>. Again: If you are running a recent version of PHP (> 4.3.0) you can skip the next section. But if you are running PHP 4.2.* or earlier, you need to manually install the manager. </para> <para> Apart from installing packages, the PEAR package manager also handles some other tasks: It can create new packages on your machine, manage a registry of installed packages, check dependencies and it can interact with an <ulink url="&url.xmlrpc;">XML-RPC</ulink> service on pear.php.net to serve some other tasks. </para> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/manually.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/manually.xml +++ peardoc/en/guide/users/installation/manually.xml <?xml version="1.0" encoding="UTF-8"?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.manually"> <title>Manual installation</title> <warning> <para> We removed this section, because, today, manually installing a package requires a deeper understanding of the way how packages are organized and what happens during the installation process. You should read the section about the <filename>package.xml</filename> in the Developers Guide (<xref linkend="developers.packagedef"/> and <xref linkend="guide.developers.package2"/>), if you really want install a package without the PEAR installer. </para> <para> If you want to install PEAR on a remote host without shell access, you should look into <xref linkend="installation.shared"/>. </para> </warning> </sect1> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/pecl.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/pecl.xml +++ peardoc/en/guide/users/installation/pecl.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.pecl"> <title>Installing PECL packages</title> <para> The procedure of installing PECL packages is described in <ulink url="&url.php.manual;en/install.pecl.php">the manual</ulink> on the PHP website. </para> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/peardoc/en/guide/users/installation/shared.xml?view=markup&rev=1.1 Index: peardoc/en/guide/users/installation/shared.xml +++ peardoc/en/guide/users/installation/shared.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <sect1 id="installation.shared"> <title>Installation of a local PEAR copy on a shared host</title> <para> Many users have a shared provider that grants access to a system-wide PEAR installation. However, in many cases, it is advantageous to have a local copy of PEAR that can be used for packages that are not installed by the host provider. There are ways of installing PEAR both for users with a telnet/ssh shell access and users who only have ftp access. </para> <sect2 id="installation.shared.shell"> <title>Installing a local copy of PEAR through SSH</title> <para> To install PEAR through SSH, you can use this command sequence to set up a local copy of PEAR: </para> <para> PEAR 1.3.5 and earlier <screen> <userinput> $ pear -s -c ~/.pearrc -d doc_dir=~/pear/docs \ -d ext_dir=~/pear/ext -d php_dir=~/pear/lib \ -d data_dir=~/pear/data -d test_dir=~/pear/tests \ -d cache_dir=~/pear/cache -d bin_dir=~/pear/bin </userinput> </screen> </para> <para> PEAR 1.4+ <screen> <userinput> $ pear config-create /home/user/pear .pearrc </userinput> </screen> </para> <para> This will create a local configuration file in a file in your home directory named <filename>.pearrc</filename>. </para> <para> Then, if you add ~/pear/bin to your path as the first entry in .bashrc (or whatever your startup file is), and run the command: </para> <para> PEAR 1.3.2 and older <screen> <userinput> $ pear -c ~/.pearrc install Archive_Tar PEAR Console_Getopt XML_RPC </userinput> </screen> </para> <para> PEAR 1.3.3+ <screen> <userinput> $ pear install -o PEAR </userinput> </screen> </para> <para> This will create a directory structure based on a subdirectory of your home directory named <filename>pear</filename> that contains all of the packages that you install. You will have a local version of PEAR that supersedes the system's copy. To use the files you have installed, you should set your PHP include_path in either the code that uses your PEAR packages like so: </para> <para> <programlisting role="php"> <![CDATA[ <?php ini_set('include_path', '~/pear/lib' . PATH_SEPARATOR . ini_get('include_path')); // From PHP 4.3.0 onward, you can use the following, // which especially useful on shared hosts: set_include_path('~/pear/lib' . PATH_SEPARATOR . get_include_path()); ?> ]]> </programlisting> </para> <para> Or, in an .htaccess file for apache using php_value. </para> </sect2> <sect2 id="installation.shared.ftp"> <title>Installing a local copy of PEAR through ftp/ftps/sftp</title> <para> There are two ways to install a local copy of PEAR through ftp: the old, difficult way, and the new, easy way. The new, easy way requires an upgrade to version 1.4.3 or newer of PEAR. </para> <sect3> <title>New improved method using PEAR 1.4.3+ and PEAR_RemoteInstaller</title> <para> Installing a local copy of PEAR through ftp has become a piece of cake in PEAR 1.4.3+. </para> <para> One of the banes of many user's existence is trying to install PEAR on a remote host that does not have shell access. Often, the only choice is to use FTP, but even this is a problem for more complex packages that take advantage of installer features like replacements. </para> <para> Here is the sequence necessary to get things running: </para> <para> <orderedlist> <listitem> <para> Make sure you are running PHP 5.0 or newer on your local computer </para> </listitem> <listitem> <para> If you wish to use ftps, make sure you have enabled the openssl extension on your local computer in php.ini. </para> </listitem> <listitem> <para> If you wish to use sftp, make sure you have enabled the ssh2 extension on your local computer in php.ini. </para> </listitem> <listitem> <para> Make sure you have a working copy of the CLI version of PEAR on your local computer (the "pear" command, not the web interface) </para> </listitem> <listitem> <para> Make sure you have ftp access to the remote host, and write access through ftp. (sftp or ftps is <emphasis>highly</emphasis> recommended for security reasons). </para> </listitem> <listitem> <para> Note the full path to your home directory </para> </listitem> <listitem> <para> Create a customized configuration file for both the local and remote host </para> </listitem> <listitem> <para> Upload the remote configuration file to the remote host </para> </listitem> <listitem> <para> Using the local configuration file, set the remote_config value to the location of the configuration file on the remote host </para> </listitem> <listitem> <para> Manage packages at will using the remote-install, remote-uninstall, remote-upgrade and remote-upgrade-all commands. </para> </listitem> </orderedlist> </para> <para> <emphasis> 1. Make sure you have a working copy of the CLI version of PEAR (the "pear" command, not the web interface) </emphasis> </para> <para> Read <link linkend="installation.cli">The installation instructions.</link> </para> <para> <emphasis> 2. Install package PEAR_RemoteInstaller locally if not already done. </emphasis> </para> <para> <emphasis> 3. Make sure you have ftp access to the remote host, and write access through ftp </emphasis> </para> <para> This is pretty straightforward - if you can login using the ftp command in a DOS prompt or from a unix shell, you have ftp access. </para> <para> Write down the user and password that you need to login. </para> <para> Testing write access is easy. If you can upload a file, you have write access. </para> <para> <emphasis> 4. Note the full path to your home directory </emphasis> </para> <para> This is also pretty straightforward. Upload this script to the root directory of your web host to find out: </para> <para> <programlisting> <![CDATA[ <?php echo dirname(__FILE__); ?> ]]> </programlisting> </para> <para> Chances are, it will be something like: <filename>/home/username/htdocs</filename> or <filename>/home/username/public_html</filename>. When you log into ftp, if you can change directory to /home/username, that's great. </para> <para> <emphasis> 5. create a customized config file for both the local and the remote host </emphasis> </para> <para> This is also quite simple. Here is how to do this on windows and unix. </para> <para> Windows first: </para> <para> Pick a location to store your local copy of the remote code. For example, <filename>C:\remote\pear</filename>. From a Command prompt (click Start here => Programs and search for the Command Prompt), type: </para> <para> <screen> <![CDATA[ C:\> mkdir remote C:\> cd remote C:\remote\> mkdir pear C:\remote\> cd pear C:\remote\pear> pear config-create -w C:\remote\pear remote.ini C:\remote\pear> pear config-create /home/username/pear .pearrc ]]> </screen> </para> <para> In Unix, follow a similar process: </para> <para> <screen> <![CDATA[ $ cd $ mkdir remote $ cd remote $ mkdir pear $ cd pear $ pear config-create /home/mylocaluser remote.conf $ pear config-create /home/username/pear .pearrc ]]> </screen> </para> <para> <emphasis> 6. upload the remote configuration file to the remote host </emphasis> </para> <para> This is straightforward - in both operating systems, use ftp to upload <filename>.pearrc</filename> to <filename>/home/username/pear/.pearrc</filename> </para> <para> <emphasis> 7. using the local configuration file, set the remote_config value to the location of the configuration file on the remote host </emphasis> </para> <para> If you wish to use unencrypted ftp (remember: this is inherently insecure), then use <literal>ftp://</literal> as your stream. If you wish to use ftps, then use <literal>ftps://</literal> as your stream. If you wish to use sftp, then use <literal>ssh2.sftp</literal> as your stream. </para> <para> The path you use for the <literal>remote_config</literal> variable may need to be a full pathname, as in: </para> <para> <screen> <![CDATA[ ssh2.sftp://user:pass@myremotehost.com/home/username/.pearrc ]]> </screen> </para> <para> If the initial connection attempt fails, try a relative path as in: </para> <para> <screen> <![CDATA[ ftps://user:pass@myremotehost.com/.pearrc ]]> </screen> </para> <para> To set the value of the <literal>remote_config</literal> configuration variable, use this syntax: </para> <para> In windows: </para> <para> <screen> <![CDATA[ C:\remote\pear\> pear -c remote.ini config-set remote_config \ ftp://user:pass@myremotehost.com/.pearrc ]]> </screen> </para> <para> In Unix: </para> <para> <screen> <![CDATA[ $ pear -c remote.conf config-set remote_config \ ftp://user:pass@myremotehost.com/.pearrc ]]> </screen> </para> <para> <emphasis> 8. Manage packages at will using the remote-install, remote-uninstall, remote-upgrade and remote-upgrade-all commands. </emphasis> </para> <para> From this point on, you can synchronize the local and the remote repositories. </para> <para> <emphasis> How does it work? </emphasis> </para> <para> The installer installs the package locally, and then uses ftp streams and uploads a copy of each locally installed file to its equivalent location remotely. All commands that affect installation (install, uninstall, upgrade, and upgrade-all) have corresponding remote- commands (remote-install, remote-uninstall, remote-upgrade, remote-upgrade-all). The "remote_config" option tells the installer how to retrieve the remote configuration file containing absolute paths where packages should be installed. </para> <para> The remote configuration file is used for any special tasks such as replacements. In other words, if a file expects to get the path to data files through the data_dir configuration directive, then it will have the path on the remote host (<filename>/home/username/pear/data</filename>) rather than the local copy ( <filename>C:\remote\pear\data</filename>). Note that packages installed this way will not work on the local machine, and should be thought of as a backup copy. In an emergency, you can always just upload the entire contents to the remote host using ftp or scp. </para> <para> It is important to note that some packages install themselves differently on windows and on unix. Be sure you know whether this is the case before installing, or ensure that your local and remote systems are the same kind of operating system. In addition, your local packages may depend on PHP extensions. To ensure these are available on the remote server, use the output of phpinfo(); to determine which extensions are available. </para> </sect3> <sect3> <title>The traditional way of installing a local copy of PEAR through ftp</title> <para> In order to install a local copy of PEAR through ftp, you must have an ftp client that can set permissions on upload. First, create a directory that is NOT in your publicly accessible web space, and name it anything you'd like. Set it to be readable and writable by any user (permissions 0777). Then, download a copy of &url.pear.go; and save it as go-pear.php. Upload go-pear.php to a subdirectory of your publicly accessible web space. It is a very good idea to password-protect the directory containing go-pear.php with an .htaccess file. </para> <para> Next, browse to the go-pear.php file. If your web address is &url.example.http;, you have placed go-pear.php in public_html/install/go-pear.php, and &url.example.http; will browse to public_html/, then browse to &url.example.http;install/go-pear.php. Follow the installation prompts. When asked where to install PEAR, choose the directory you created to be readable and writable by any user. You will need to know the location of the cli version of PHP. To find this, browse to this script and copy the output: </para> <para> <programlisting role="php"> <![CDATA[ <?php echo `which php`; // if this does not work, also try echo PHP_BIN; ?> ]]> </programlisting> </para> <para> After PEAR has been installed, you can use the web installer to install and upgrade packages just as you would with any other PEAR installation. To use the files, you must set the include path in scripts on the website. </para> <para> <programlisting role="php"> <![CDATA[ <?php ini_set('include_path', '~/pear/lib' . PATH_SEPARATOR . ini_get('include_path')); // From PHP 4.3.0 onward, you can use the following, // which especially useful on shared hosts: set_include_path('~/pear/lib' . PATH_SEPARATOR . get_include_path()); ?> ]]> </programlisting> </para> </sect3> </sect2> </sect1> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->