cvs: peardoc /en/chapters installation.xml /en/chapters/installation cli.xml cvs.xml getting.xml introduction.xml pecl.xml shared.xml

From: Date: Sat, 25 Nov 2006 17:38:55 +0000
Subject: cvs: peardoc /en/chapters installation.xml /en/chapters/installation cli.xml cvs.xml getting.xml introduction.xml pecl.xml shared.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8885@lists.php.net to get a copy of this message
cweiske Sat Nov 25 17:38:55 2006 UTC Added files: /peardoc/en/chapters/installation cli.xml cvs.xml getting.xml introduction.xml pecl.xml shared.xml Modified files: /peardoc/en/chapters installation.xml Log: Split installation.xml into multiple files to make it more manageable (2000 lines in a single XML file are not managable!)

http://cvs.php.net/viewvc.cgi/peardoc/en/chapters/installation.xml?r1=1.46&r2=1.47&diff_format=u Index: peardoc/en/chapters/installation.xml diff -u peardoc/en/chapters/installation.xml:1.46 peardoc/en/chapters/installation.xml:1.47 --- peardoc/en/chapters/installation.xml:1.46 Sat Nov 25 17:16:49 2006 +++ peardoc/en/chapters/installation.xml Sat Nov 25 17:38:55 2006 @@ -1,1165 +1,24 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.46 $ --> +<!-- $Revision: 1.47 $ --> <chapter id="installation"> <chapterinfo> <author> <firstname>Martin</firstname> <surname>Jansen</surname> </author> - <date>2002-02-10</date> + <date>2006-11-25</date> </chapterinfo> <title>Installation</title> <simpara> This chapter describes, how to install packages from PEAR. </simpara> - <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 is comparable to Debian's - <quote><ulink url="&url.debian.apt;">apt-get</ulink></quote>. Again: - If you are running a recent version of PHP (&gt; 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> - - <sect1 id="installation.getting"> - <title>Getting the manager</title> - - <sect2> - <title>Unix/Linux/BSD</title> - <para> - When using PHP &gt;= 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> -&dollar; lynx -source http://go-pear.org/ | 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 specific during installation. - Finally you have to add that installation path to your - <literal>PATH</literal> environment. Either do this manually (Start &gt; - Control Panel &gt; System &gt; 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> - <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> -&dollar; pear install &lt;package&gt; - </userinput> - </screen> - </para> - <para> - &lt;package&gt; 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 &quot;-beta&quot; or &quot;-alpha&quot; - suffix, depending on the current state of the package: - </para> - <para> - <screen> - <userinput> -&dollar; pear install &lt;package&gt;-beta - </userinput> - </screen> - </para> - <para> - There are also other options to install a beta or alpha package, using the - &quot;-f&quot; switch to force the installation, or setting the - preferred_state to beta. Any of the following commands will do: - </para> - <para> - <screen> - <userinput> -&dollar; pear config-set preferred_state beta -&dollar; pear install &lt;package&gt; -&dollar; pear config-set preferred_state stable - </userinput> - </screen> - </para> - <para> - <screen> - <userinput> -&dollar; pear -d preferred_state=beta install &lt;package&gt; - </userinput> - </screen> - </para> - <para> - <screen> - <userinput> -&dollar; pear install -f &lt;package&gt; - </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> -&dollar; 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> -&dollar; pear install &lt;file&gt;.tgz - </userinput> - </screen> - </para> - <para> - This command will automatically install the package and does not - require an online connection. <filename>&lt;file&gt;.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> - - <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> -&dollar; 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> -&dollar; 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> -&dollar; pear -c ~/.pearrc install Archive_Tar PEAR Console_Getopt XML_RPC - </userinput> - </screen> - </para> - <para> - PEAR 1.3.3+ - <screen> - <userinput> -&dollar; 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 loging 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 =&gt; - 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 &quot;remote_config&quot; 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> - - <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> - - <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/&lt;packagename&gt;</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 fileset entries. - They must match the existing files and directory structure. If they differ, contact - the maintainer and ask for an update of <filename>package.xml</filename>. - </para> - </listitem> - <listitem> - <para> - Create a valid package using the PEAR Installer - <command>pear package &lt;path to package.xml&gt;</command> - </para> - </listitem> - <listitem> - <para> - If you have already the package installed: remove it to avoid versions problems: - <command>pear uninstall &lt;package&gt;</command> - </para> - </listitem> - <listitem> - <para> - Install your package archive: - <command>pear install &lt;package-file&gt;</command> - </para> - <para> - Now, you have an CVS version installed! - </para> - </listitem> - </orderedlist> - <para> - You should upgrade to a official release of the package as early as possible. - Before you install the official release, uninstall the CVS version to avoid - version problems. - </para> - </sect1> - - <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> + &chapters.installation.introduction; + &chapters.installation.getting; + &chapters.installation.cli; + &chapters.installation.shared; + &chapters.installation.cvs; + &chapters.installation.pecl; </chapter> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/chapters/installation/cli.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/installation/cli.xml +++ peardoc/en/chapters/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> &dollar; pear install &lt;package&gt; </userinput> </screen> </para> <para> &lt;package&gt; 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 &quot;-beta&quot; or &quot;-alpha&quot; suffix, depending on the current state of the package: </para> <para> <screen> <userinput> &dollar; pear install &lt;package&gt;-beta </userinput> </screen> </para> <para> There are also other options to install a beta or alpha package, using the &quot;-f&quot; switch to force the installation, or setting the preferred_state to beta. Any of the following commands will do: </para> <para> <screen> <userinput> &dollar; pear config-set preferred_state beta &dollar; pear install &lt;package&gt; &dollar; pear config-set preferred_state stable </userinput> </screen> </para> <para> <screen> <userinput> &dollar; pear -d preferred_state=beta install &lt;package&gt; </userinput> </screen> </para> <para> <screen> <userinput> &dollar; pear install -f &lt;package&gt; </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> &dollar; 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> &dollar; pear install &lt;file&gt;.tgz </userinput> </screen> </para> <para> This command will automatically install the package and does not require an online connection. <filename>&lt;file&gt;.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/chapters/installation/cvs.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/installation/cvs.xml +++ peardoc/en/chapters/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/&lt;packagename&gt;</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 fileset entries. They must match the existing files and directory structure. If they differ, contact the maintainer and ask for an update of <filename>package.xml</filename>. </para> </listitem> <listitem> <para> Create a valid package using the PEAR Installer <command>pear package &lt;path to package.xml&gt;</command> </para> </listitem> <listitem> <para> If you have already the package installed: remove it to avoid versions problems: <command>pear uninstall &lt;package&gt;</command> </para> </listitem> <listitem> <para> Install your package archive: <command>pear install &lt;package-file&gt;</command> </para> <para> Now, you have an CVS version installed! </para> </listitem> </orderedlist> <para> You should upgrade to a official release of the package as early as possible. Before you install the official release, uninstall the CVS version to avoid version problems. </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/chapters/installation/getting.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/installation/getting.xml +++ peardoc/en/chapters/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 &gt;= 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> &dollar; lynx -source http://go-pear.org/ | 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 specific during installation. Finally you have to add that installation path to your <literal>PATH</literal> environment. Either do this manually (Start &gt; Control Panel &gt; System &gt; 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/chapters/installation/introduction.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/installation/introduction.xml +++ peardoc/en/chapters/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 is comparable to Debian's <quote><ulink url="&url.debian.apt;">apt-get</ulink></quote>. Again: If you are running a recent version of PHP (&gt; 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/chapters/installation/pecl.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/installation/pecl.xml +++ peardoc/en/chapters/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/chapters/installation/shared.xml?view=markup&rev=1.1 Index: peardoc/en/chapters/installation/shared.xml +++ peardoc/en/chapters/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> &dollar; 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> &dollar; 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> &dollar; pear -c ~/.pearrc install Archive_Tar PEAR Console_Getopt XML_RPC </userinput> </screen> </para> <para> PEAR 1.3.3+ <screen> <userinput> &dollar; 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 loging 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 =&gt; 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 &quot;remote_config&quot; 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> <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> <!-- 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 -->
« previous php.pear.doc (#8885) next »