|
|
 |
This section contains notes and hints specific to installing
PHP on Debian GNU/Linux.
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.
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.
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 pear commandline
utility.
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 http://www.apt-get.org/.
One of the results found should be
Dotdeb. This unofficial repository
is maintained by Guillaume Plessis
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
/etc/apt/sources.lists and run apt-get
update :
Ejemplo 4-7. The two Dotdeb related lines deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all |
|
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 apt-get update
before anything else. This way, you will be using the most recent
stable version of the Apache and PHP packages.
Now that everything is in place, you can use the following example
to install Apache and PHP:
Ejemplo 4-8. Debian Install Example with Apache 1.3 # apt-get install libapache-mod-php4 |
|
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 :
Ejemplo 4-9. Stopping and starting Apache once PHP 4 is installed # /etc/init.d/apache stop
# /etc/init.d/apache start |
|
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.
When you compile PHP from source yourself, you need to activate modules
via the configure 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).
Ejemplo 4-10. Getting the list of PHP additional packages |
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.
If you choose to add the MySQL, cURL and GD support to PHP the command
will look something like this:
Ejemplo 4-11. Install PHP with MySQL, cURL and GD # apt-get install php4-mysql php4-curl php4-gd |
|
APT will automatically add the appropriate lines to your
different php.ini (/etc/php4/apache/php.ini,
/etc/php4/cgi/php.ini, etc).
Ejemplo 4-12. These lines activate MySQL, cURL and GD into PHP extension=mysql.so
extension=curl.so
extension=gd.so |
|
You'll only have to stop/start Apache as previously to activate the modules.
If you see the PHP source instead of the result the script should
produce, APT has probably not included
/etc/apache/conf.d/php4 in your Apache 1.3
configuration. Please ensure that the following line is present in your
/etc/apache/httpd.conf file then stop/start Apache:
Ejemplo 4-13. This line activates PHP 4 into Apache # Include /etc/apache/conf.d/ |
|
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.
add a note
User Contributed Notes
Debian GNU/Linux installation notes
Ben A.
17-Dec-2005 10:53
Although there are no PHP 5 packages for Debian 3.1 (aka "stable" or "sarge"), there are currently PHP 5 packages for "testing"/"etch" and "unstable"/"sid". Installation works the same way.
Also, the same process can be used for Ubuntu, but note that some of the packages may be in the "universe" section instead of "main".
jimmychan at example dot com
23-Oct-2005 10:01
If you are using Debian 3.1
It is total, the php.ini is under
/etc/php4/apache2
Since Debian 3.1 default apache is 2.0.x version, this one just said how to change the php.ini under apache 1.3.x
If you need enable the ext. need manaul edit php.ini, and comment out # of what the ext. that you want to enable
Of course, you much first install the ext. first by like that
apt-get install php4-gd php4-mysql ......
| |
| | Citas célebres | Lo más curioso de mi madre es que durante treinta años alimentó a la familia sólo con sobras. La comida inicial nunca ha aparecido. Calvin Trillin Periodista y humorista estadounidense (n. 1935) | | Citas en tu mail | | ©Contenidos Gratis |
| Chiste de... Médicos | | Milagros | - ¡Este doctor hace verdaderos milagros! Curó a mi mujer en tres segundos.
- ¡No es posible!
- Pues sí: le dijo que todas sus enfermedades no eran mas que síntomas de la proximidad de la vejez. | | Chistes en tu mail | | ©ContenidosGratis |
| Inicio | Acción | Estrategia | Palabras | Puzzles | Solitarios | Foro Trucos |  | Cake Mania Jugadores: 6835 Categoría del juego: Acción Objetivo del juego: Ayuda a Jill a recuperar la pastelería de su abuela llevando su propia pastelería; consigue clientes y gana dinero. |
|  | Rainbow Web Jugadores: 2199 Categoría del juego: Puzzles Objetivo del juego: Rompe un pegajoso hechizo y salva un reino de fantasía en Rainbow Web. Tendrás toneladas de diversión mientras juegas a este mágico desafío para la mente. |
|  | Mahjongg Fortuna Jugadores: 12462 Categoría del juego: Solitarios Objetivo del juego: Velocidad y habilidad mental son las armas más importantes en esta versión de un antiguo juego asiático. Despeja el tablero lo antes posible haciendo clic en las fichas iguales y gánate la fama eterna de la puntuación más alta. |
|  | Chainz 2 Jugadores: 6955 Categoría del juego: Puzzles Objetivo del juego: Entra en el mundo de las combinaciones con Chainz 2: Relinked, emocionante secuela del exitazo del año pasado, Chainz. Gira eslabones y crea combinaciones de 3 ó más. |
|  | Delicious Jugadores: 4405 Categoría del juego: Acción Objetivo del juego: ¿Eres un as de la multitarea? ¿Quieres que tus clientes estén contentos? ¡Pues Delicious es tu juego! Sacia el apetito de los clientes y tenlos contentos; ¡no te arriesgues! |
|  | Bookworm Jugadores: 4568 Categoría del juego: Palabras Objetivo del juego: Junta las letras para formar palabras. ¡Las palabras más largas valen más puntos! |
|  | Zuma Jugadores: 4976 Categoría del juego: Acción Objetivo del juego: Controla el ídolo de la rana de piedra de los antiguos Zuma en este intrigante enigma de acción. ¡Dispara bolas para formar conjuntos de tres, pero si dejas que lleguen a la calavera dorada morirás! |
|  | Jewel of Atlantis Jugadores: 3798 Categoría del juego: Puzzles Objetivo del juego: Descubre la ciudad hundida de la Atlántida y busca valiosos tesoros. Viaja más allá de las profundidades del mar y vive trepidantes aventuras en Jewel of Atlantis. |
|  | Jewel Quest Jugadores: 3727 Categoría del juego: Puzzles Objetivo del juego: Convierte la arena de la antigua selva en oro tan rápido como puedas juntando grupos de 3 elementos. ¡Los grupos más grandes valen más puntos! |
|  | Bejeweled 2 Jugadores: 3659 Categoría del juego: Puzzles Objetivo del juego: Con cuatro modos de juego únicos y fascinantes, nuevas piezas de juego explosivas e imponentes fondos planetarios, Bejeweled 2 es mucho más adictivo que nunca. |
|
|