Intergrating PHP con Apache en Linux

  • Cheeseboy
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 25, 2005
  • Mensajes: 106
  • Status: Offline

Nota Marzo 9th, 2006, 5:32 pm

Hola, Me gustaría saber si alguien me puede dar instrucciones sobre la forma de intergrate apache con php y tal vez el manual tendría un ejemplo. :D








Programadores Thx!
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Marzo 9th, 2006, 5:32 pm

  • this213
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Mar 01, 2004
  • Mensajes: 1242
  • Loc: ./
  • Status: Offline

Nota Marzo 9th, 2006, 7:14 pm

Para que la distribución?

Esto debería estar en la Linux / Unix foro por cierto
  • Cheeseboy
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 25, 2005
  • Mensajes: 106
  • Status: Offline

Nota Marzo 10th, 2006, 8:45 am

para Slackware
  • radnor
  • Beginner
  • Beginner
  • No Avatar
  • Registrado: Mar 06, 2006
  • Mensajes: 40
  • Status: Offline

Nota Marzo 10th, 2006, 8:50 am

Knoppix o Kanotix lo tiene.
  • this213
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Mar 01, 2004
  • Mensajes: 1242
  • Loc: ./
  • Status: Offline

Nota Marzo 10th, 2006, 9:02 am

Si está instalando PHP 5 de fuente, el método general es:

Código: [ Select ]
$ tar -jxvf php-VERSION.tar.bz2
$ ./configure \
--enable-force-cgi-redirect \
--with-mysql \
--enable-modules=php5 \
--with-gd \

# make && make install
  1. $ tar -jxvf php-VERSION.tar.bz2
  2. $ ./configure \
  3. --enable-force-cgi-redirect \
  4. --with-mysql \
  5. --enable-modules=php5 \
  6. --with-gd \
  7. # make && make install

Puede que necesite - with-apsx2, no recuerdo si necesita esto para PHP 5 en Slackware (Id tienen que comprobar).

Para llegar a jugar muy bien con Apache, agregue esto a su httpd.conf:
Código: [ Select ]
AddType application/x-httpd-php .php

y también puede que desee agregar a su línea index.php DirectoryIndex allí, así que parece algo así como:
Código: [ Select ]
DirectoryIndex index.php index.html index.shtml
  • Cheeseboy
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 25, 2005
  • Mensajes: 106
  • Status: Offline

Nota Marzo 10th, 2006, 9:06 am

Bueno, yo no significa que nadie tiene un manual para algo que me muestra cómo utilizar php en apache, por ejemplo.
Quote:
http://localhost/test.php
Modo de empleo (. Php) en los archivos de apache.



Thx
  • this213
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Mar 01, 2004
  • Mensajes: 1242
  • Loc: ./
  • Status: Offline

Nota Marzo 10th, 2006, 9:13 am

poner esto en un archivo de texto sin formato en su web raíz:
[php] <? php
phpinfo ();
> [/ php]
guardarlo como punto something.php entonces su navegador para http://localhost/something.php

Si esto no es lo que usted está pidiendo, entonces no sé lo que quieres decir. Todo lo que necesitas hacer para usar un script PHP es poner el script en su directorio web raíz (/ var / www / html por defecto)
  • Cheeseboy
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 25, 2005
  • Mensajes: 106
  • Status: Offline

Nota Marzo 10th, 2006, 10:12 am

Ya, pero puede mi servidor apache leer el archivo. Php archivos de forma predeterminada no tengo que cambiar nada?
  • this213
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Mar 01, 2004
  • Mensajes: 1242
  • Loc: ./
  • Status: Offline

Nota Marzo 10th, 2006, 10:21 am

As I escribió:
Para llegar a jugar muy bien con Apache, agregue esto a su httpd.conf:
Código: [ Select ]
AddType application/x-httpd-php .php

y también puede que desee agregar a su línea index.php DirectoryIndex allí, así que parece algo así como:
Código: [ Select ]
DirectoryIndex index.php index.html index.shtml
  • Cheeseboy
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 25, 2005
  • Mensajes: 106
  • Status: Offline

Nota Marzo 10th, 2006, 3:27 pm

¿Debo dejar esto?
Quote:
AddType application / x-tar. Tgz
o poner tu uno en su lugar?
  • this213
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Mar 01, 2004
  • Mensajes: 1242
  • Loc: ./
  • Status: Offline

Nota Marzo 10th, 2006, 3:31 pm

Ponga debajo de las minas que
  • Cheeseboy
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 25, 2005
  • Mensajes: 106
  • Status: Offline

Nota Marzo 10th, 2006, 4:29 pm

cuando trato de reiniciar Apache después de haberse puesto que dice que los theres un error de sintaxis en la línea donde he añadido. Aquí es
Código: [ Select ]
bash-3.00# apachectl restart
/usr/sbin/apachectl restart: httpd not running, trying to start
Syntax error on line 239 of /etc/apache/httpd.conf:
Cannot load /usr/modules/libphp5.so into server: /usr/modules/libphp5.so: cannot open shared object file: No such file or directory
/usr/sbin/apachectl restart: httpd could not be started
  1. bash-3.00# apachectl restart
  2. /usr/sbin/apachectl restart: httpd not running, trying to start
  3. Syntax error on line 239 of /etc/apache/httpd.conf:
  4. Cannot load /usr/modules/libphp5.so into server: /usr/modules/libphp5.so: cannot open shared object file: No such file or directory
  5. /usr/sbin/apachectl restart: httpd could not be started
  • this213
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Mar 01, 2004
  • Mensajes: 1242
  • Loc: ./
  • Status: Offline

Nota Marzo 10th, 2006, 5:04 pm

¿Qué versión de Slackware es esto?

Vea si usted tiene un archivo en / etc/apache2/mod_php.conf

Si lo hace, asegúrese de que existe esta línea en:
LoadModule php5_module lib/apache2/libphp5.so

Y asegúrese de que esta línea está en su httpd.conf:
Incluir / etc/apache2/mod_php.conf


Si no, basta con añadir esta línea a su httpd.conf
LoadModule php5_module lib/apache2/libphp5.so


Asegúrese de hacer esto en httpd. Conf antes de que usted:
AddType application / x-httpd-php. Php

Si, a pesar de errores, intente ejecutar el script de prueba desde la línea de comandos y ver si se da cualquier error. Por otra parte, ver su error en los registros de Apache y ver si su diciéndole tiene ninguna ventaja.
  • Cheeseboy
  • Graduate
  • Graduate
  • No Avatar
  • Registrado: Jul 25, 2005
  • Mensajes: 106
  • Status: Offline

Nota Marzo 10th, 2006, 5:56 pm

Código: [ Select ]
#
# mod_php - PHP Hypertext Preprocessor module
#

#LoadModule php4_module libexec/libphp4.so
LoadModule php4_module libexec/apache/libphp4.so
#AddModule mod_php4.c

# Tell Apache to feed all *.php files through the PHP module:
AddType application/x-httpd-php .php

# This will display PHP files in colored syntax form. Use with caution.
#AddType application/x-httpd-php-source .phps
  1. #
  2. # mod_php - PHP Hypertext Preprocessor module
  3. #
  4. #LoadModule php4_module libexec/libphp4.so
  5. LoadModule php4_module libexec/apache/libphp4.so
  6. #AddModule mod_php4.c
  7. # Tell Apache to feed all *.php files through the PHP module:
  8. AddType application/x-httpd-php .php
  9. # This will display PHP files in colored syntax form. Use with caution.
  10. #AddType application/x-httpd-php-source .phps





Eso es lo que mi / etc/apache2/mod_php.conf parece que tiene algo similar a la línea de lucir bien para ti?
  • this213
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Mar 01, 2004
  • Mensajes: 1242
  • Loc: ./
  • Status: Offline

Nota Marzo 10th, 2006, 6:11 pm

OK, puede eliminar la línea que he dicho de poner en su httpd.conf, porque existe en su:
AddType application / x-httpd-php. Php

sólo asegúrate de incluir la línea que existe en su httpd.conf (fijado para el camino correcto):
Incluir / etc/apache2/mod_php.conf

¿Está corriendo PHP 4 o PHP 5?
LoadModule php4_module libexec/apache/libphp4.so

Si está tratando de instalar PHP 4, no se moleste. Vaya logro que PHP 5.

¿Está ejecutando Apache 1.x? Si es así, usted puede ser que al igual que mejorar también.

Una vez más, ¿qué versión de la distribución Slackware es esto, no ver exactamente reciente.
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Marzo 10th, 2006, 6:11 pm

Publicar Información

  • Total de mensajes en este tema: 18 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 76 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC