cvs: phpdoc /en/install/unix debian.xml
| From: | Philip Olson | Date: | Mon, 13 Apr 2009 22:59:57 +0000 |
| Subject: | cvs: phpdoc /en/install/unix debian.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3707@lists.php.net to get a copy of this message | ||
philip Mon Apr 13 22:59:57 2009 UTC
Modified files:
/phpdoc/en/install/unix debian.xml
Log:
Rewrote this to be simpler and work with current debian, php and apache versions
http://cvs.php.net/viewvc.cgi/phpdoc/en/install/unix/debian.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/install/unix/debian.xml diff -u phpdoc/en/install/unix/debian.xml:1.5 phpdoc/en/install/unix/debian.xml:1.6 --- phpdoc/en/install/unix/debian.xml:1.5 Wed Jun 20 22:24:11 2007 +++ phpdoc/en/install/unix/debian.xml Mon Apr 13 22:59:57 2009 @@ -1,147 +1,96 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.6 $ --> <sect1 xml:id="install.unix.debian" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Debian GNU/Linux installation notes</title> <para> This section contains notes and hints specific to installing PHP on <link xlink:href="&url.debian;">Debian GNU/Linux</link>. </para> + <para> + The instructions for building PHP on Unix apply to Debian too, although + this manual page contains specific information for other options like + using either the <literal>apt-get</literal> or <literal>aptitude</literal> + commands. This manual page uses these two commands interchangeably. + </para> <sect2 xml:id="install.unix.debian.apt"> <title>Using APT</title> <simpara> - While you can just download the PHP source and compile it yourself, - using Debian's packaging system is the simplest and cleanest - method of installing PHP. If you are not familiar with building - software on Linux, this is the way to go. - </simpara> - <simpara> - The first decision you need to make is whether you want to install - Apache 1.3.x or Apache 2.x. The corresponding PHP packages are - respectively named libapache-mod-php* and libapache2-mod-php*. - The steps given below will use Apache 1.3.x. - Please note that, as of this writing, there is no official - Debian packages of PHP 5. Then the steps given below will install PHP 4. - </simpara> - <simpara> - PHP is available in Debian as CGI or CLI flavour too, named respectively - php4-cgi and php4-cli. If you need them, you'll just have to reproduce the - following steps with the good package names. - Another special package you'd want to install is php4-pear. It contains a - minimal PEAR installation and the <command>pear</command> commandline - utility. - </simpara> - <simpara> - If you need more recent packages of PHP than the Debian's stable ones - or if some PHP modules lacks the Debian official repository, perhaps - you should take a look at <link xlink:href="&url.apt-get;">http://www.apt-get.org/</link>. - One of the results found should be - <link xlink:href="http://www.dotdeb.org/">Dotdeb</link>. This unofficial repository - is maintained by <link xlink:href="mailto:gui@php.net">Guillaume Plessis</link> - and contains Debian packages of the most recent versions of PHP 4 and PHP 5. - To use it, just add the to following two lines to your - <filename>/etc/apt/sources.lists</filename> and run <command>apt-get - update</command> : + First, note that other related packages may be desired like + <literal>libapache2-mod-php5</literal> to integrate with Apache 2, and + <literal>php-pear</literal> for PEAR. </simpara> - <example> - <title>The two Dotdeb related lines</title> - <programlisting role="shell"> -<![CDATA[ -deb http://packages.dotdeb.org stable all -deb-src http://packages.dotdeb.org stable all -]]> - </programlisting> - </example> <simpara> - The last thing to consider is whether your list of packages is up to date. - If you have not updated it recently, you need to run <command>apt-get update</command> - before anything else. This way, you will be using the most recent - stable version of the Apache and PHP packages. - </simpara> - <simpara> - Now that everything is in place, you can use the following example - to install Apache and PHP: + Second, before installing a package it's wise to ensure the package list + is up to date. Typically this is done by running the command + <command>apt-get update</command>. </simpara> <example xml:id="install.unix.debian.apt.example"> - <title>Debian Install Example with Apache 1.3</title> + <title>Debian Install Example with Apache 2</title> <programlisting role="shell"> <![CDATA[ -# apt-get install libapache-mod-php4 +# apt-get install php5-common libapache2-mod-php5 php5-cli ]]> </programlisting> </example> <simpara> - APT will automatically install the PHP 4 module for Apache 1.3, and all its - dependencies and then activate it. If you're not asked to restart Apache - during the install process, you'll have to do it manually : + APT will automatically install the PHP 5 module for Apache 2, and all of its + dependencies and then activate it. Apache should be restarted in order for + the changes take place. For example: </simpara> <example xml:id="install.unix.debian.apt.example2"> - <title>Stopping and starting Apache once PHP 4 is installed</title> + <title>Stopping and starting Apache once PHP is installed</title> <programlisting role="shell"> <![CDATA[ -# /etc/init.d/apache stop -# /etc/init.d/apache start +# /etc/init.d/apache2 stop +# /etc/init.d/apache2 start ]]> </programlisting> </example> </sect2> <sect2 xml:id="install.unix.debian.config"> - <title>Better control on configuration</title> - <simpara> - In the last section, PHP was installed with only core modules. - This may not be what you want and you will soon discover that you need - more activated modules, like MySQL, cURL, GD, etc. - </simpara> + <title>Better control of configuration</title> <simpara> - When you compile PHP from source yourself, you need to activate modules - via the <command>configure</command> command. With APT, you just have - to install additional packages. They're all named 'php4-*' (or 'php5-*' if - you installed PHP 5 from a third party repository). + In the last section, PHP was installed with only core modules. It's + very likely that additional modules will be desired, such as + <link linkend="book.mysql">MySQL</link>, + <link linkend="book.curl">cURL</link>, + <link linkend="book.image">GD</link>, + etc. These may also be installed via the <literal>apt-get</literal> command. </simpara> <example xml:id="install.unix.debian.config.example"> - <title>Getting the list of PHP additional packages</title> + <title>Methods for listing additional PHP 5 packages</title> <programlisting role="shell"> <![CDATA[ -# dpkg -l 'php4-*' +# apt-cache search php5 +# aptitude search php5 +# aptitude search php5 |grep -i mysql ]]> </programlisting> </example> <simpara> - As you can see from the last output, there's a lot of PHP modules that - you can install (excluding the php4-cgi, php4-cli or php4-pear special - packages). - Look at them closely and choose what you need. If you choose a module and - you do not have the proper libraries, APT will automatically install all - the dependencies for you. - </simpara> - <simpara> - If you choose to add the MySQL, cURL and GD support to PHP the command - will look something like this: + The examples will show a lot of packages including several PHP specific ones + like php5-cgi, php5-cli and php5-dev. Determine which are needed + and install them like any other with either <literal>apt-get</literal> + or <literal>aptitude</literal>. And because Debian performs + dependency checks, it'll prompt for those so for example to install + MySQL and cURL: </simpara> <example xml:id="install.unix.debian.config.example2"> - <title>Install PHP with MySQL, cURL and GD</title> + <title>Install PHP with MySQL, cURL</title> <programlisting role="shell"> <![CDATA[ -# apt-get install php4-mysql php4-curl php4-gd +# apt-get install php5-mysql php5-curl ]]> </programlisting> </example> <simpara> - APT will automatically add the appropriate lines to your - different &php.ini; (<filename>/etc/php4/apache/php.ini</filename>, - <filename>/etc/php4/cgi/php.ini</filename>, etc). - </simpara> - <example xml:id="install.unix.debian.config.example3"> - <title>These lines activate MySQL, cURL and GD into PHP</title> - <programlisting role="shell"> -<![CDATA[ -extension=mysql.so -extension=curl.so -extension=gd.so -]]> - </programlisting> - </example> - <simpara> - You'll only have to stop/start Apache as previously to activate the modules. + APT will automatically add the appropriate lines to the + different &php.ini; related files like + <filename>/etc/php5/apache2/php.ini</filename>, + <filename>/etc/php5/conf.d/pdo.ini</filename>, etc. and depending on + the extension will add entries similar to <literal>extension=foo.so</literal>. + However, restarting the web server (like Apache) is required before these + changes take affect. </simpara> </sect2> <sect2 xml:id="install.unix.debian.faq"> @@ -149,27 +98,25 @@ <itemizedlist> <listitem> <simpara> - If you see the PHP source instead of the result the script should - produce, APT has probably not included - <filename>/etc/apache/conf.d/php4</filename> in your Apache 1.3 - configuration. Please ensure that the following line is present in your - <filename>/etc/apache/httpd.conf</filename> file then stop/start Apache: + If the PHP scripts are not parsing via the web server then likely + PHP was not added to web servers configuration file which on Debian + may be <filename>/etc/apache2/apache2.conf</filename> or similar. + See the Debian manual for further details. + </simpara> + </listitem> + <listitem> + <simpara> + If an extension was seemingly installed yet the functions are undefined, + be sure that the appropriate ini file is being loaded and/or the web + server was restarted after installation. </simpara> - <example xml:id="install.unix.debian.faq.example"> - <title>This line activates PHP 4 into Apache</title> - <programlisting role="shell"> -<![CDATA[ -# Include /etc/apache/conf.d/ -]]> - </programlisting> - </example> </listitem> <listitem> <simpara> - If you installed an additional module and if its functions are not - available in your scripts, please ensure that the appropriate line is present in your - &php.ini;, as seen before. APT may fail during the installation - of the additional module, due to a confusing debconf configuration. + There are two basic commands for installing packages on Debian (and other + linux variants): <literal>apt-get</literal> and <literal>aptitude</literal>. + However, explaining the subtle differences between these commands goes + beyond the scope of this manual. </simpara> </listitem> </itemizedlist>
http://cvs.php.net/viewvc.cgi/phpdoc/en/install/unix/debian.xml?r1=1.5&r2=1.6&diff_format=u Index: phpdoc/en/install/unix/debian.xml diff -u phpdoc/en/install/unix/debian.xml:1.5 phpdoc/en/install/unix/debian.xml:1.6 --- phpdoc/en/install/unix/debian.xml:1.5 Wed Jun 20 22:24:11 2007 +++ phpdoc/en/install/unix/debian.xml Mon Apr 13 22:59:57 2009 @@ -1,147 +1,96 @@ -<?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<?xml version="1.0" encoding="utf-8"?> +<!-- $Revision: 1.6 $ --> <sect1 xml:id="install.unix.debian" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Debian GNU/Linux installation notes</title> <para> This section contains notes and hints specific to installing PHP on <link xlink:href="&url.debian;">Debian GNU/Linux</link>. </para> + <para> + The instructions for building PHP on Unix apply to Debian too, although + this manual page contains specific information for other options like + using either the <literal>apt-get</literal> or <literal>aptitude</literal> + commands. This manual page uses these two commands interchangeably. + </para> <sect2 xml:id="install.unix.debian.apt"> <title>Using APT</title> <simpara> - While you can just download the PHP source and compile it yourself, - using Debian's packaging system is the simplest and cleanest - method of installing PHP. If you are not familiar with building - software on Linux, this is the way to go. - </simpara> - <simpara> - The first decision you need to make is whether you want to install - Apache 1.3.x or Apache 2.x. The corresponding PHP packages are - respectively named libapache-mod-php* and libapache2-mod-php*. - The steps given below will use Apache 1.3.x. - Please note that, as of this writing, there is no official - Debian packages of PHP 5. Then the steps given below will install PHP 4. - </simpara> - <simpara> - PHP is available in Debian as CGI or CLI flavour too, named respectively - php4-cgi and php4-cli. If you need them, you'll just have to reproduce the - following steps with the good package names. - Another special package you'd want to install is php4-pear. It contains a - minimal PEAR installation and the <command>pear</command> commandline - utility. - </simpara> - <simpara> - If you need more recent packages of PHP than the Debian's stable ones - or if some PHP modules lacks the Debian official repository, perhaps - you should take a look at <link xlink:href="&url.apt-get;">http://www.apt-get.org/</link>. - One of the results found should be - <link xlink:href="http://www.dotdeb.org/">Dotdeb</link>. This unofficial repository - is maintained by <link xlink:href="mailto:gui@php.net">Guillaume Plessis</link> - and contains Debian packages of the most recent versions of PHP 4 and PHP 5. - To use it, just add the to following two lines to your - <filename>/etc/apt/sources.lists</filename> and run <command>apt-get - update</command> : + First, note that other related packages may be desired like + <literal>libapache2-mod-php5</literal> to integrate with Apache 2, and + <literal>php-pear</literal> for PEAR. </simpara> - <example> - <title>The two Dotdeb related lines</title> - <programlisting role="shell"> -<![CDATA[ -deb http://packages.dotdeb.org stable all -deb-src http://packages.dotdeb.org stable all -]]> - </programlisting> - </example> <simpara> - The last thing to consider is whether your list of packages is up to date. - If you have not updated it recently, you need to run <command>apt-get update</command> - before anything else. This way, you will be using the most recent - stable version of the Apache and PHP packages. - </simpara> - <simpara> - Now that everything is in place, you can use the following example - to install Apache and PHP: + Second, before installing a package it's wise to ensure the package list + is up to date. Typically this is done by running the command + <command>apt-get update</command>. </simpara> <example xml:id="install.unix.debian.apt.example"> - <title>Debian Install Example with Apache 1.3</title> + <title>Debian Install Example with Apache 2</title> <programlisting role="shell"> <![CDATA[ -# apt-get install libapache-mod-php4 +# apt-get install php5-common libapache2-mod-php5 php5-cli ]]> </programlisting> </example> <simpara> - APT will automatically install the PHP 4 module for Apache 1.3, and all its - dependencies and then activate it. If you're not asked to restart Apache - during the install process, you'll have to do it manually : + APT will automatically install the PHP 5 module for Apache 2, and all of its + dependencies and then activate it. Apache should be restarted in order for + the changes take place. For example: </simpara> <example xml:id="install.unix.debian.apt.example2"> - <title>Stopping and starting Apache once PHP 4 is installed</title> + <title>Stopping and starting Apache once PHP is installed</title> <programlisting role="shell"> <![CDATA[ -# /etc/init.d/apache stop -# /etc/init.d/apache start +# /etc/init.d/apache2 stop +# /etc/init.d/apache2 start ]]> </programlisting> </example> </sect2> <sect2 xml:id="install.unix.debian.config"> - <title>Better control on configuration</title> - <simpara> - In the last section, PHP was installed with only core modules. - This may not be what you want and you will soon discover that you need - more activated modules, like MySQL, cURL, GD, etc. - </simpara> + <title>Better control of configuration</title> <simpara> - When you compile PHP from source yourself, you need to activate modules - via the <command>configure</command> command. With APT, you just have - to install additional packages. They're all named 'php4-*' (or 'php5-*' if - you installed PHP 5 from a third party repository). + In the last section, PHP was installed with only core modules. It's + very likely that additional modules will be desired, such as + <link linkend="book.mysql">MySQL</link>, + <link linkend="book.curl">cURL</link>, + <link linkend="book.image">GD</link>, + etc. These may also be installed via the <literal>apt-get</literal> command. </simpara> <example xml:id="install.unix.debian.config.example"> - <title>Getting the list of PHP additional packages</title> + <title>Methods for listing additional PHP 5 packages</title> <programlisting role="shell"> <![CDATA[ -# dpkg -l 'php4-*' +# apt-cache search php5 +# aptitude search php5 +# aptitude search php5 |grep -i mysql ]]> </programlisting> </example> <simpara> - As you can see from the last output, there's a lot of PHP modules that - you can install (excluding the php4-cgi, php4-cli or php4-pear special - packages). - Look at them closely and choose what you need. If you choose a module and - you do not have the proper libraries, APT will automatically install all - the dependencies for you. - </simpara> - <simpara> - If you choose to add the MySQL, cURL and GD support to PHP the command - will look something like this: + The examples will show a lot of packages including several PHP specific ones + like php5-cgi, php5-cli and php5-dev. Determine which are needed + and install them like any other with either <literal>apt-get</literal> + or <literal>aptitude</literal>. And because Debian performs + dependency checks, it'll prompt for those so for example to install + MySQL and cURL: </simpara> <example xml:id="install.unix.debian.config.example2"> - <title>Install PHP with MySQL, cURL and GD</title> + <title>Install PHP with MySQL, cURL</title> <programlisting role="shell"> <![CDATA[ -# apt-get install php4-mysql php4-curl php4-gd +# apt-get install php5-mysql php5-curl ]]> </programlisting> </example> <simpara> - APT will automatically add the appropriate lines to your - different &php.ini; (<filename>/etc/php4/apache/php.ini</filename>, - <filename>/etc/php4/cgi/php.ini</filename>, etc). - </simpara> - <example xml:id="install.unix.debian.config.example3"> - <title>These lines activate MySQL, cURL and GD into PHP</title> - <programlisting role="shell"> -<![CDATA[ -extension=mysql.so -extension=curl.so -extension=gd.so -]]> - </programlisting> - </example> - <simpara> - You'll only have to stop/start Apache as previously to activate the modules. + APT will automatically add the appropriate lines to the + different &php.ini; related files like + <filename>/etc/php5/apache2/php.ini</filename>, + <filename>/etc/php5/conf.d/pdo.ini</filename>, etc. and depending on + the extension will add entries similar to <literal>extension=foo.so</literal>. + However, restarting the web server (like Apache) is required before these + changes take affect. </simpara> </sect2> <sect2 xml:id="install.unix.debian.faq"> @@ -149,27 +98,25 @@ <itemizedlist> <listitem> <simpara> - If you see the PHP source instead of the result the script should - produce, APT has probably not included - <filename>/etc/apache/conf.d/php4</filename> in your Apache 1.3 - configuration. Please ensure that the following line is present in your - <filename>/etc/apache/httpd.conf</filename> file then stop/start Apache: + If the PHP scripts are not parsing via the web server then likely + PHP was not added to web servers configuration file which on Debian + may be <filename>/etc/apache2/apache2.conf</filename> or similar. + See the Debian manual for further details. + </simpara> + </listitem> + <listitem> + <simpara> + If an extension was seemingly installed yet the functions are undefined, + be sure that the appropriate ini file is being loaded and/or the web + server was restarted after installation. </simpara> - <example xml:id="install.unix.debian.faq.example"> - <title>This line activates PHP 4 into Apache</title> - <programlisting role="shell"> -<![CDATA[ -# Include /etc/apache/conf.d/ -]]> - </programlisting> - </example> </listitem> <listitem> <simpara> - If you installed an additional module and if its functions are not - available in your scripts, please ensure that the appropriate line is present in your - &php.ini;, as seen before. APT may fail during the installation - of the additional module, due to a confusing debconf configuration. + There are two basic commands for installing packages on Debian (and other + linux variants): <literal>apt-get</literal> and <literal>aptitude</literal>. + However, explaining the subtle differences between these commands goes + beyond the scope of this manual. </simpara> </listitem> </itemizedlist>