cvs: peardoc /en/chapters installation.xml

From: Date: Thu, 24 Mar 2005 05:58:21 +0000
Subject: cvs: peardoc /en/chapters installation.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-5720@lists.php.net to get a copy of this message
cellog Thu Mar 24 00:58:21 2005 EDT Modified files: /peardoc/en/chapters installation.xml Log: update for PEAR 1.4.0 commands, config values, and installation via remoteinstall option.

http://cvs.php.net/diff.php/peardoc/en/chapters/installation.xml?r1=1.21&r2=1.22&ty=u Index: peardoc/en/chapters/installation.xml diff -u peardoc/en/chapters/installation.xml:1.21 peardoc/en/chapters/installation.xml:1.22 --- peardoc/en/chapters/installation.xml:1.21 Tue Mar 22 12:38:45 2005 +++ peardoc/en/chapters/installation.xml Thu Mar 24 00:58:20 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.21 $ --> +<!-- $Revision: 1.22 $ --> <!-- WORK IN PROGRESS, THERE IS PROBABLY LITTLE POINT IN TRANSLATING THIS DOCUMENT YET. @@ -111,7 +111,8 @@ <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't use the PEAR Package Manager. If you are customer of a + can't use the PEAR Installer unless you are using PEAR 1.4.x and have + ftp access (sftp access is not yet supported). If you are customer of a smart web hosting company, the chances are very well that the most commonly used PEAR packages are already installed on the machine that is hosting your site. If that is not the case or if @@ -226,10 +227,38 @@ </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> @@ -246,6 +275,10 @@ <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 @@ -281,6 +314,14 @@ <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> @@ -317,6 +358,10 @@ <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> @@ -337,6 +382,10 @@ <entry>Uninstall and remove a packge</entry> </row> <row> + <entry>update-channels</entry> + <entry>Update the channel list (PEAR 1.4+)</entry> + </row> + <row> <entry>upgrade</entry> <entry> Upgrade a packge to the current version (see also: @@ -374,7 +423,7 @@ <entry>bin_dir</entry> <entry>Directory where executables are installed</entry> <entry><filename>/usr/bin</filename></entry> - </row> + </row> <row> <entry>doc_dir</entry> <entry>Directory where documentation is installed</entry> @@ -438,7 +487,7 @@ <entry>verbose</entry> <entry>Debug log level: 0-3 where 3 is full debug mode.</entry> <entry>1</entry> - </row> + </row> <row> <entry>http_proxy</entry> <entry> @@ -446,10 +495,33 @@ packages </entry> <entry> </entry> - </row> + </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</entry> + <entry>PEAR server [deprecated in PEAR 1.4+]</entry> <entry>pear.php.net</entry> </row> <row> @@ -504,6 +576,7 @@ 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 \ @@ -513,6 +586,14 @@ </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>. In addition, it 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. @@ -522,6 +603,7 @@ (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 @@ -529,6 +611,14 @@ </screen> </para> <para> + PEAR 1.3.3+ + <screen> + <userinput> +&dollar; pear install -o PEAR + </userinput> + </screen> + </para> + <para> 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> @@ -548,43 +638,271 @@ <sect2 id="installation.shared.ftp"> <title>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 http://go-pear.org 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 http://www.example.com, you have placed - go-pear.php in public_html/install/go-pear.php, and http://www.example.com will browse to public_html/, - then browse to http://www.example.com/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: + 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 the latest and greatest + version of PEAR. </para> - <para> - <programlisting role="php"> + <sect3> + <title>New improved method using PEAR 1.4.0 and Net_FTP</title> + <para> + Installing a local copy of PEAR through ftp has become a piece of cake in PEAR 1.4.0+. + </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 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 + </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> + Install packages at will! + </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 <ulink url="&url.pear.manual;/en/installation.cli.php">The installation instructions.</ulink> + </para> + <para> + <emphasis> + 2. 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. Note that sftp is not yet supported + by PEAR, but will be as soon as the Net_FTP package supports sftp. + </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> + 3. 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>. + When you log into ftp, if you can change directory to /home/username, that's great. + </para> + <para> + <emphasis> + 4. 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> + 5. 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> + 6. using the local configuration file, set the remote_config value to the + location of the configuration file on the remote host + </emphasis> + </para> + <para> + In windows: + </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> + 7. install packages at will! + </emphasis> + </para> + <para> + From this point on, you can use the pear command normally, and it will automatically + synchronize the local and the remote repositories. + </para> + <para> + <emphasis> + How does it work? + </emphasis> + </para> + <para> + Simple. The installer installs the package locally, and then uses Net_FTP and uploads + a copy of each locally installed file to its equivalent location remotely. All commands + that affect installation (install, upgrade, even upgrade-all) can be used with this + option. The "remote_config" option tells the installer that it should automatically + mirror the local copy to the remote host. + </para> + <para> + Even more exciting, the remote configuration file is used for any 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>). This has + one side effect: the local copy will not work on the local machine, but if you think + of it as a backup copy (In an emergency, you can always just upload the entire contents + to the remote host using regular old ftp or scp), the reasoning becomes obvious. + </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. + </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 http://go-pear.org 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 http://www.example.com, you have placed + go-pear.php in public_html/install/go-pear.php, and http://www.example.com will browse to public_html/, + then browse to http://www.example.com/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"> + </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')); ?> ]]> - </programlisting> - </para> + </programlisting> + </para> + </sect3> </sect2> </sect1>
« previous php.pear.doc (#5720) next »