PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Problemas de Compilación> <Problemas con bases de datos
Last updated: Fri, 11 Apr 2008

view this page in

Instalación

Esta sección contiene preguntas comunes sobre el modo de instalar PHP. PHP se encuentra disponible para casi cualquier SO (excepto quizás por MacOS antes de OSX), y casi cualquier servidor web.

Para instalar PHP, siga las instrucciones en Instalación y configuración.

  1. ¿Porqué no debo usar Apache 2 con un módulo de multi-procesamiento (MPM) multi-hilos en un entorno en producción?
  2. Unix/Windows: ¿En dónde debe estar ubicado mi archivo php.ini?
  3. Unix: Instalé PHP, ¡pero cada vez que cargo un documento, recibo el mensaje 'Document Contains No Data'! ¿Qué está pasando aquí?
  4. Unix: Instalé PHP usando RPMS, ¡pero Apache no está procesando las páginas PHP! ¿Qué está pasando aquí?
  5. Unix: Instalé PHP 3 usando RPMS, ¡pero no compila con el soporte de bases de datos que necesito! ¿Qué está pasando?
  6. Unix: He aplicado el parche de extensiones FrontPage a Apache, y de pronto PHP dejó de funcionar. ¿Es PHP incompatible con las extensiones FrontPage de Apache?
  7. Unix/Windows: He instalado PHP, pero cuando intento acceder a un script PHP a través de mi navegador, recibo una pantalla en blanco.
  8. Unix/Windows: He instalado PHP, pero cuando intento acceder a un script PHP a través de mi navegador, recibo un error 500 de servidor.
  9. Algunos sistemas operativos: He instalado PHP sin errores, pero cuando intento iniciar apache, recibo errores de símbolos indefinidos: [mi_maquina:usuario /src/php4] root# apachectl configtest apachectl: /usr/local/apache/bin/httpd Undefined symbols: _compress _uncompress
  10. Windows: He instalado PHP, pero cuando intento acceder a un script PHP a través de mi navegador, recibo el error: cgi error: The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
  11. Windows: He seguido todas las instrucciones, ¡pero aun no logro que PHP e IIS trabajen juntos!
  12. Cuando corro PHP como CGI con IIS, PWS, OmniHTTPD o Xitami, recibo el siguiente error: Security Alert! PHP CGI cannot be accessed directly..
  13. ¿Cómo sé si mi php.ini está siendo encontrado y leído? Pareciera que mis cambios no están siendo implementados.
  14. ¿Cómo agrego mi directorio de PHP a la variable PATH en Windows?
  15. ¿Cómo hago que el archivo php.ini se encuentre disponible para PHP en windows?
  16. ¿Es posible usar la negociación de contenido de Apache (opción MultiViews) con PHP?
  17. ¿PHP se limita a procesar los métodos de petición GET y POST solamente?

¿Porqué no debo usar Apache 2 con un módulo de multi-procesamiento (MPM) multi-hilos en un entorno en producción?

PHP es pegamento. Es el pegamento usado para construir interesantes aplicaciones web, uniendo docenas de bibliotecas externas y haciéndolas parecer una entidad coherente a través de una interfaz de lenguaje intuitiva y fácil de aprender. La flexibilidad y poder de PHP depende de la estabilidad y robustez de la plataforma subyacente. Necesita de un SO que funcione, un servidor web que funcione y unas bibliotecas externas que funcionen para unirlo todo. Cuando uno cualquiera de estos elementos deja de trabajar, PHP necesita identificar los problemas y solucionarlos rápidamente. Al hacer más complejo el marco de referencia base, no disponiendo de hilos de ejecución completamente separados, segmentos de memoria completamente separados y una caja de arena segura para que cada petición trabaje, se introduce una base débil al sistema de PHP.

Si siente que necesita usar un MPM multi-hilos, puede echarle un vistazo a la configuración FastCGI, en donde PHP corre en su propio espacio de memoria.

Y finalmente, note que esta advertencia contra el uso de un MPM multi-hilos no tiene tanta fuerza en sistemas Windows, ya que la mayoría de bibliotecas en esa platafarma tienden a ser seguras en entornos multi-hilo.

Unix/Windows: ¿En dónde debe estar ubicado mi archivo php.ini?

De forma predeterminada, en Unix debe estar en /usr/local/lib, lo que es, <ruta-instalacion>/lib. La mayoría de personas querrán modificar este valor en tiempo de compilación con la bandera --with-config-file-path. Podría, por ejemplo, definirla como:

--with-config-file-path=/etc
      
Y luego copiaría php.ini-dist desde su distribución a /etc/php.ini y lo editaría para hacer cualquier modificación local que desee.

--with-config-file-scan-dir=PATH
      

En windows, la ruta predeterminada para el archivo php.ini es el directorio de windows. Si está usando el servidor web Apache, php.ini será buscado primero en el directorio de instalación de Apache, p.ej. c:\program files\apache group\apache. De este modo, puede contar con diferentes archivos php.ini para diferentes versiones de Apache en la misma máquina.

Vea también el capítulo sobre el archivo de configuración.

Unix: Instalé PHP, ¡pero cada vez que cargo un documento, recibo el mensaje 'Document Contains No Data'! ¿Qué está pasando aquí?

Esto probablemente quiere decir que PHP está sufriendo algún tipo de dificultad y está produciendo volcados de memoria. Eche un vistazo a su registro de errores del servidor para ver si éste es el caso, y luego trate de reproducir el problema con un pequeño caso de prueba. Si sabe cómo usar 'gdb', es muy útil cuando puede proveer un backtrace con su reporte de fallo para ayudar a los desarrolladores a ubicar el problema. Si está usando PHP como módulo de Apache, intente algo como:

  • Detener todos sus procesos httpd

  • gdb httpd

  • Detener todos sus procesos httpd

  • > run -X -f /ruta/hacia/httpd.conf

  • Luego recuperar la URL que causa el problema con su navegador

  • > run -X -f /ruta/hacia/httpd.conf

  • Si está recibiendo un volcado de memoria, gdb debe informarle de ésto.

  • escriba: bt

  • Ahora debe incluir su backtrace en su reporte de fallo. Éste debe ser enviado desde » http://bugs.php.net/

Si su script usa las funciones de expresiones regulares (ereg() y amigas), debe asegurarse de que compiló PHP y Apache con el mismo paquete de expresiones regulares. Esto debe pasar automáticamente con PHP y Apache 1.3.x

Unix: Instalé PHP usando RPMS, ¡pero Apache no está procesando las páginas PHP! ¿Qué está pasando aquí?

Asumiendo que ha instalado tanto Apache como PHP desde paquetes RPM, necesita remover los caracteres de comentario, o agregar algunas o todas de las siguientes líneas en su archivo httpd.conf:

# Módulos Extra
AddModule mod_php.c
AddModule mod_php3.c
AddModule mod_perl.c

# Módulos Extra
LoadModule php_module         modules/mod_php.so
LoadModule php3_module        modules/libphp3.so     # para PHP 3
LoadModule php4_module        modules/libphp4.so     # para PHP 4
LoadModule perl_module        modules/libperl.so
Y agregar:
AddType application/x-httpd-php3 .php3    # para PHP 3
AddType application/x-httpd-php .php      # para PHP 4
... a las propiedades globales, o a las propiedades del VirtualDomain para el cual desea tener soporte de PHP.

Unix: Instalé PHP 3 usando RPMS, ¡pero no compila con el soporte de bases de datos que necesito! ¿Qué está pasando?

Debido a la forma en que se compila PHP 3, no es sencillo crear un RPM de PHP flexible completo. Este problema es atendido en PHP 4. Para PHP 3, actualmente le sugerimos que use el mecanismo descrito en el archivo INSTALL.REDHAT en la distribución de PHP. Si insiste en usar una versión RPM para PHP 3, continúe leyendo...

Los empaquetadores de RPM están configurando los RPMS para ser instalados sin soporte de bases de datos para simplificar las instalaciones y porque los RPMS usan /usr/ en lugar del directorio /usr/local/ estándar para los archivos. Usted necesita decirle al archivo spec del RPM cuáles bases de datos soportar y la ubicación del nivel más alto de su servidor de bases de datos.

Este ejemplo explicará el proceso de agregar soporte para el popular servidor de bases de datos MySQL, usando la instalación de módulo para Apache.

Por supuesto, toda esta información puede ser ajustada para cualquier servidor de bases de datos soportada por PHP. Asumiremos que ha instalado MySQL y Apache completamente con RPMS para este ejemplo también.

  • Primero remueva mod_php3 :

    rpm -e mod_php3
             

  • Luego obtenga el rpm fuente e INSTÁLELO, NO use --rebuild

    rpm -Uvh mod_php3-3.0.5-2.src.rpm
             

  • Luego edite el archivo /usr/src/redhat/SPECS/mod_php3.spec

    En la sección %build agrege el soporte de bases de datos que desea, y la ruta.

    Para MySQL, usted agregaría --with-mysql=/usr La sección %build se verá algo como:

    ./configure --prefix=/usr \
    --with-apxs=/usr/sbin/apxs \
    --with-config-file-path=/usr/lib \
    --enable-debug=no \
    --enable-safe-mode \
    --with-exec-dir=/usr/bin \
    --with-mysql=/usr \
    --with-system-regex
             

  • Una vez está hecha esta modificación, compile el rpm binario de este modo:

    rpm -bb /usr/src/redhat/SPECS/mod_php3.spec
             

  • Luego instale el rpm

    rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm
             

Asegúrese de reiniciar Apache, y ahora tendrá PHP 3 con soporte para MySQL usando RPM's. Note que probablemente es mucho más fácil simplemente compilar a partir del tarball de distribución de PHP 3 y seguir las instrucciones encontradas en INSTALL.REDHAT.

Unix: He aplicado el parche de extensiones FrontPage a Apache, y de pronto PHP dejó de funcionar. ¿Es PHP incompatible con las extensiones FrontPage de Apache?

No, PHP trabaja bien con las extensiones FrontPage. El problema es que el parche de FrontPage modifica varias estructuras de Apache en las que depende PHP. Recompilar PHP (usando 'make clean ; make') después de que se ha aplicado el parche FP debe solucionar el problema.

Unix/Windows: He instalado PHP, pero cuando intento acceder a un script PHP a través de mi navegador, recibo una pantalla en blanco.

Seleccione la acción 'ver código fuente' en el navegador web y probablemente encontrará el código fuente de su script PHP. Esto quiere decir que el servidor web no envió el script a PHP para su interpretación. Algo está mal en la configuración del servidor - revise cuidadosamente la configuración del servidor con las instrucciones de instalación de PHP.

Unix/Windows: He instalado PHP, pero cuando intento acceder a un script PHP a través de mi navegador, recibo un error 500 de servidor.

Algo falló cuando el servidor intentó ejecutar PHP. Para poder ver un mensaje de error más útil, desde la línea de comandos, vaya al directorio que contiene el ejecutable PHP (php.exe en Windows) y ejecute php -i. Si PHP tiene algún problema corriendo, entonces se desplegará un mensaje de error apropiado, el cual le dará una pista sobre lo que debe hacer a continuación. Si recibe una pantalla llena de códigos HTML (la salida de la función phpinfo()) entonces PHP está funcionando, y su problema puede estar relacionado con la configuración de su servidor, la cual debe revisar de nuevo.

Algunos sistemas operativos: He instalado PHP sin errores, pero cuando intento iniciar apache, recibo errores de símbolos indefinidos:

[mi_maquina:usuario /src/php4] root# apachectl configtest
 apachectl: /usr/local/apache/bin/httpd Undefined symbols:
  _compress
  _uncompress
      

Esto no tiene nada que ver con PHP en realidad, sino con las bibliotecas de cliente de MySQL. Algunas necesitan --with-zlib, otras no. Este tema también se cubre en el FAQ sobre MySQL.

Windows: He instalado PHP, pero cuando intento acceder a un script PHP a través de mi navegador, recibo el error:

cgi error:
 The specified CGI application misbehaved by not
 returning a complete set of HTTP headers.
 The headers it did return are:
      

El mensaje de error significa que PHP falló en su intento de producir una salida. Para poder ver un mensaje de error más útil, desde la línea de comandos, vaya al directorio que contiene el ejecutable de PHP (php.exe en Windows) y ejecute php -i. Si PHP tiene algún problema ejecutándose, entonces se desplegará un mensaje de error apropiado, el cual le dará una pista sobre lo que necesita hacer a continuación. Si recibe una pantalla llena de códigos HTML (la salida de la función phpinfo()) entonces PHP está funcionando.

Una vez PHP esté trabajando desde la línea de comandos, intente acceder al script desde el navegador nuevamente. Si aun falla, entonces la causa puede ser alguna de las siguientes:

  • Los permisos de archivo en su script PHP, php.exe, php4ts.dll, php.ini o cualquier extensión PHP que esté tratando cargar son de tal forma que el usuario anónimo de internet ISUR_<nombre_maquina> no tiene acceso a estos recursos.
  • El archivo del script no existe (o posiblemente no se encuentra en donde cree que está, relativo a su directorio web raíz). Note que para IIS, puede atrapar este error seleccionando la caja 'check file exists' cuando esté configurando la gestión de scripts bajo Internet Services Manager. Si un archivo de script no existe, entonces el servidor devolverán un error 404 en su lugar. También existe el beneficio adicional de que IIS se encargará de cualquier autenticación requerida por usted, basado en los permisos NTLanMan en su archivo de script.

Windows: He seguido todas las instrucciones, ¡pero aun no logro que PHP e IIS trabajen juntos!

¡Asegúrese de que cualquier usuario que necesite ejecutar un script PHP tenga los permisos para ejecutar php.exe! IIS usa un usuario anónimo que es agregado al momento de instalar IIS. Este usuario necesita privilegios sobre php.exe. También, cualquier usuario autenticado necesitará permisos para ejecutar php.exe. Y para IIS4, necesita decirle que PHP es un motor de scripts. Asimismo, querrá leer este faq.

Cuando corro PHP como CGI con IIS, PWS, OmniHTTPD o Xitami, recibo el siguiente error: Security Alert! PHP CGI cannot be accessed directly..

Debe definir la directiva cgi.force_redirect como 0. Su valor predeterminado es 1, así que asegúrese de que la directiva no se encuentre comentada (con un ;). Como todas las directivas, ésta se define en php.ini

Debido a que su valor predeterminado es 1, es importante que esté 100% seguro de que el archivo php.ini correcto está siendo leído. Lea este faq para más detalles.

¿Cómo sé si mi php.ini está siendo encontrado y leído? Pareciera que mis cambios no están siendo implementados.

Para asegurarse de que su php.ini está siendo leído por PHP, haga un llamado a phpinfo(), y cerca del comienzo encontrará un listado llamado Configuration File (php.ini). Éste le dirá en dónde está buscando PHP el archivo php.ini y si está siendo leído o no. Si sólo existe un directorio PATH, entonces no está siendo leído y debe colocar su php.ini en ese directorio. Si php.ini es incluido con la ruta PATH, entonces está siendo leído.

Si php.ini está siendo leido y está ejecutando PHP como un módulo, entonces asegúrese de reiniciar su navegador web después de hacer cambios a php.ini

¿Cómo agrego mi directorio de PHP a la variable PATH en Windows?

En Windows NT, 2000, XP y 2003:

  • Diríjase al Panel de Control y abra el ícono de Sistema (Inicio -> Configuración -> Panel de Control -> Sistema, o simplemente Inicio -> Panel de Control -> Sistema en Windows XP/2003)

  • Vaya a la solapa Avanzado

  • Pulse el botón 'Variables de Entorno'

  • Consulte el panel de 'Variables de Sistema'

  • Encuentre la entrada Path (puede que tenga que desplazarse por la lista para encontrarla)

  • Haga doble clic sobre la entrada Path

  • Ingrese su directorio PHP al final, incluyendo ';' al comienzo (p.ej. ;C:\php)

  • Presione Aceptar y reinicie su máquina

En Windows 98/Me necesita editar el archivo autoexec.bat:

  • Abra el Bloc de Notas (Inicio -> Ejecutar y escriba notepad)

  • Abra el archivo C:\autoexec.bat

  • Ubique la línea con PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;..... y agregue: ;C:\php al final de la línea

  • Guarde el archivo y reinicie su máquina

Note: Asegúrese de reiniciar después de seguir los anteriores pasos para asegurarse de que los cambias a PATH sean aplicados.

El manual de PHP solía promover la copia de archivos al directorio system de Windows, esto es porque el directorio (C:\Windows, C:\WINNT, etc.) se encuentra por defecto en el valor PATH del sistema. Copiar archivos en el directorio system de Windows se considera obsoleto desde hace bastante tiempo, y puede causar problemas.

¿Cómo hago que el archivo php.ini se encuentre disponible para PHP en windows?

Existen varias formas de lograr esto. Si está usando Apache, lea sus instrucciones específicas de instalación (Apache 1, Apache 2), o de lo contrario debe definir la variable de entorno PHPRC:

En Windows NT, 2000, XP y 2003:

  • Diríjase al Panel de Control y abra el ícono de Sistema (Inicio -> Configuración -> Panel de Control -> Sistema, o simplemente Inicio -> Panel de Control -> Sistema para Windows XP/2003)

  • Vaya a la solapa de Avanzado

  • Pulse sobre el botón 'Variables de Entorno'

  • Consulte el panel de 'Variables de sistema'

  • Pulse sobre 'Nueva' e ingrese 'PHPRC' como el nombre de variable y el directorio en donde se encuentra php.ini como el valor de la variable (p.ej. C:\php)

  • Pulse aceptar y reinicie su máquina

En Windows 98/Me necesita editar el archivo autoexec.bat:

  • Abra el Bloc de Notas (Inicio -> Ejecutar e ingrese notepad)

  • Abra el archivo C:\autoexec.bat

  • Agrege una nueva línea al final del archivo: set PHPRC=C:\php (reemplace C:\php con el directorio en donde se encuentra php.ini). Por favor note que la ruta no puede contener espacios. Por ejemplo si tiene instalado PHP en C:\Archivos de Programa\PHP, usted debería ingresar C:\ARCHIV~1\PHP en su lugar.

  • Guarde el archivo y reinicie su máquina

¿Es posible usar la negociación de contenido de Apache (opción MultiViews) con PHP?

Si los enlaces a archivos PHP incluyen la extensión, todo trabaja perfectamente. Este FAQ es sólo para el caso en el que los enlaces a archivos PHP no incluyen la extensión y se desea usar la negociación de contenido para elegir archivos PHP de una URL sin extensión. En este caso reemplace la línea AddType application/x-httpd-php .php con:

# PHP 4
AddHandler php-script php
AddType text/html php

# PHP 5
AddHandler php5-script php
AddType text/html php
Esta solución no funciona con Apache 1 ya que el módulo PHP no atrapa php-script.

¿PHP se limita a procesar los métodos de petición GET y POST solamente?

No, es posible manejar cualquier método de petición, p.ej. CONNECT. La respuesta de status apropiada puede ser enviada con header(). Si solo los métodos GET y POST debieran ser manejados, puede conseguirse con esta configuración de Apache:

<LimitExcept GET POST>
Deny from all
</LimitExcept>



Problemas de Compilación> <Problemas con bases de datos
Last updated: Fri, 11 Apr 2008
 
add a note add a note User Contributed Notes
Instalación
john dot calder at manukau dot ac dot nz
04-May-2008 07:19
WINDOWS 2003 and IIS.  BIG LESSON FOR ME was "don't mess with the optional components".
I had lots of trouble until I tried installing without asking for extras and then it was very smooth.
I have found no need to set up paths. 
I have found no need to configure IIS. 
I have found no need to change security on the PHP folder.

What works for me with Windows/IIS:

1.  You need to be logged-on as "administrator"

2.  Run  "php-5.2.6-win32-installer.msi"
Your ONLY action during this wizard is to select "IIS ISAPI" as the webserver.  Do NOT CHANGE anything else!  I am guessing that the optional extras apply only to Apache because after enabling them I see Apache-related error messages.

3.  Setup a test virtual directory as you would for an ASP or ASP.NET web app.  eg "phptest"
Then use notepad to create a test page eg "test.php"
<?php
phpinfo
();
?>

4.  In Internet Explorer, test with eg this address
http://localhost/phptest/test.php

IF this does not give you a beautiful page of details THEN start reading other advice on this page - especially helpful for me was the faq advice to test run "php.exe -i" from the command prompt.
charleslynch at xybersoftware dot com
18-Apr-2008 04:30
One final note to the message below if you are getting the message about not having rights to execute...You need to use IIS right click on the website and choose 'Properties/Home Directory' then on the 'Execute Permissions' combo box you need to choose 'Scripts only'...Click ok...another dialog may appear asking which directories to apply the action too...choose any directories that you intend on using php in and click ok...It should work now...
charleslynch at xybersoftware dot com
17-Apr-2008 08:50
To get php 5.2.5 to work in IIS on Windows Server 2003

1. Install PHP choose the IIS ISAPI webserver option on the first panel of the php install
2. Make sure your website is accessible for example make sure it works with html files
3. Now startup IIS and click on the Web Sevice Extensions folder icon, you should see the PHP Hypertext Processor installled and enabled. Click on the 'All Unknown ISAPI Extensions' and then click the 'Allow' button.
4. Now you need to give the internet users access to the php executable directory ie c:\php or c:\program files\php by using internet explorer and right clicking the php directory and choosing Properties/Security/Add...Now in the 'Select Users or Groups' dialog that appears in the 'Enter the Object Names to select' type in the name of the internet guest account (ie IUSER_TEMPLATE in my case)...click the check names to make sure you got it right and click the OK button.  Finally in the PHP properties dialog click the Internet Guest Account icon and set the permissions to be 'Read & Execute, List Folder Contents and Read'.  Click ok and now it should work.  Create a very simple php file and test it...

If you get the 404 file not found error then the ISAPI extensions are not allowed (#3 above)
If you get a blank page then the ISAPI extensions are probably setup right but you need to give the internet user access rights to the php executable directory (#4 above)
joerg at fenin dot de
02-Nov-2007 11:35
To limit HTTP Request Methods on the Apache server running PHP you should use mod_rewrite or mod_security instead of LimitExcept, to give you more control over the handling of such http errors.  Can go in .htaccess file or httpd.conf

# mod_rewrite
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|POST)$
  RewriteRule .* - [F,L]
</IfModule>

# mod_security
<IfModule mod_security.c>
  SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST)$" "deny,log,status:403"
</IfModule>

You can use the php request method scanner at askapache to see exactly how your server deals with various request methods, and check that your server is configured properly.. 

http://www.askapache.com/online-tools/request-method-scanner/
scott at chaisson dot net
20-Sep-2007 06:18
Windows 2000 Server and IIS (SP4 and all patches):

After many frustrating hours of trying to figure out the install (again), It took a while, but here are a couple tips:

PHP working with IIS uses c:\winnt\php.ini

It doesn't matter what you set the path to, nor what you set the PHPRC environment variable to. After you get PHP running correctly in the installation folder (using php -i) copy the php.ini file into the c:\winnt folder.

Here's what worked for me:

- Add PHP path to System environment variable

- Add php5activescript.dll from http://snaps.php.net/ to the PHP folder, then Register it: "regsvr32 php5activescript.dll"

Set extension_dir and doc_root directives in PHP.INI:
  extension_dir = C:\WWW\PHP\ext
  doc_root = C:\WWW\Site
  cgi.force_redirect = 0

(the last cgi.force_redirect isn't required, but I like to set it anyway)

Copy the .INI file into WINNT folder

In IIS Manager, right-click "Default Web Site", Click "Home Directory",
  Click "Configuration", "Add" the ISAPI application:
    Executable: <your php install>\php5isapi.dll
    Extension: .php
    Limit to: GET,HEAD,POST
    Check: "Script Engine"
    Uncheck: "Check that file exists"

Finally: Set up an ISAPI filter:
  Click the "ISAPI Filters" tab,
  Filter Name: PHP
  Executable: <your php install>\php5isapi.dll

Notes: You don't have to set any of your folders as "Script source" folders. .PHP files aren't scripts, merely text files that require processing before being shipped off to the browser, which is what the ISAPI filter does.

Finally, working again.

Chase
christianfelix at laszlo dot com
17-Jul-2007 12:39
For Windows XP users

Just add php.ini to windows/system 32 and also save a copy in the setup folder e.g. c:/php/php.ini, c:/php5/php.ini,

You have to follow the suggestions, add to path, uncomment extensions and voila!!
Meiki67 skipthis at geemail
08-Jun-2007 01:41
Had a hard day to MSI install 5.2.3 on WinXP with MySQL. I use a drive substitution (subst drive: path - in my case subst d: c:\drive_d) and installed PHP in D:\PHP - which in reality is C:\DRIVE_D\PHP.  To make a long story short - only after (1) changing all substituted D:\ back to C:\DRIVE_D and (2) resolving all DOS short names to Win long names PHP started to work. The first one is clear - the substitution works only for the active console user - not for services or IUSR. For the second one I have no explanation, since DOS short names should work systemwide - maybe Win handles them correctly but PHP not ?

BTW <?php phpinfo(); ?> was of tremendeous help

Meiki
gui dot priaulx at gmail dot com
03-Jun-2007 09:05
When i first installed PHP 5.2 / 5.1 on Windows 2k3 server standard edition, i got error 404's on every page i tried to load, i then noticed that in the file extention configuration list, .php files where going to E:\PHP\\php5isapi.dll or something similar, the problem was the two back slashes, i'm not sure what their purpose is. After i changed it too one, PHP worked well for about 5 minutes then the Application poop started to crash and a whole new bag of problems fell open, but thats just observation if it helps anyone.
Curtis
19-May-2007 04:39
I have some additional troubleshooting tips for 53.7, which deals with getting a blank screen on your browser when running a PHP script.

In addition to server misconfiguration, it may also be that PHP isn't configured to output errors to the browser, which is the case if you or your host uses a more secure php.ini. If this is the case, you need to find out where errors are being logged to find out if any errors are preventing normal output from being delivered to the client.

If you have access to php.ini, check the 'display_errors' directive, which is, by default, located under the 'error_reporting' directive. It's helpful to have 'display_errors' on during debugging phases, but best to have it off in production environments.

Related functions: http://php.net/ini_set | http://php.net/error_reporting | http://php.net/error_log
knutw at sparhell dot no
07-Nov-2006 06:15
I recntly upgraded from PHP 5.1 to 5.2 on my Windows Server 2003 using IIS6. I selected CGI as before. My PHP folder is as always C:\Program Files\PHP. I also edited my brand new php.ini, enabling all my old extensions and recommended settings for IIS. I like not to keep my old config into a new version.

After upgrade, I just got blank pages in my browser, and the response status was 404 Not found.

I checked my installation twice, using this FAQ, but got no way.

Then I went to IIS Manager, Web Service Extensions. The php Service Extension was Allowed as it should. I deleted the Service Extension and added it. The old extension used short file names containing tilde (PROGRA~) character, but I don'æt know if that gas anything to do with the problem. Anyway, after allowing my" new" Service Extension, pointing to php-cgi.exe as before, mye web sites suddenly worked. So will revommend anyone with thos problem to delete and add the Servcie Extension. It didn't help re-allowing it, restarting IIS or the complete server.
14-Sep-2006 04:03
After setting the PHPRC environment variable, none of my PHP files would hit the preprocessor. The browser was just serving out PHP source code right there in the "view source."

The manual was telling me to set this var to "c:\php," but nothing was working. It's almost as if IIS/Win2000 wasn't reading my php.ini at all.

After I set that variable to "c:\php\php.ini," all of a sudden I was getting honest to goodness PHP pages working.
info at kylierose dot com dot au
03-May-2006 12:22
I had trouble using IIS and PHP with Firefox. If you are having similar problems then take a look at this article: http://blogs.wdevs.com/shog9/archive/2005/03/09/2668.aspx
emzeperx at emzeper dot hu
01-Jan-2006 09:36
You do not have to restart the whole system make effect of changing the PATH env var. For me (sbs2003) worked automatically.
on older systems you can use

set $Path=%path%;c:\php

command to extend immediately the path var.
JUSTANOTHERUSER
14-Aug-2005 08:23
<LimitExcept GET POST>
Deny from all
</LimitExcept>

Does not work with Apache2+ & PHP5 . Apache Refuses to start
per dot fikse at ipj dot no
12-Jul-2005 10:22
Installing PHP 4 or 5 on Windows Server 2003 x64 results in http error 505. This is not a PHP bug. It is due to running a 32-bit ISAPI DLL under the 64-bit version of IIS 6, as documented here: http://support.microsoft.com/?id=895976

Solution: Flip the Metabase flag for Enable32bitAppOnWin64 as described in http://support.microsoft.com/?id=894435 ,
like this: CSCRIPT ADSUTIL.VBS SET W3SVC/AppPools/Enable32bitAppOnWin64 1

(Alternatively with full path: cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1)
patrick hat paddyworks dot com
23-May-2005 06:52
In setting up PHP 5.0.4 + IIS 6  I can concur with vlad at vkelman dot com that setting the environment variable PHPRC is ineffective at telling IIS where to look for php.ini.  The only place PHP5 seems to successfully find php.ini is in C:\Windows.  Using PHPIniDir with Apache2 works like a charm, however.
vlad at vkelman dot com
02-Mar-2005 05:45
In addition of what jimo at mail dot azhsv dot com said:

I don't know which idiot at Microsoft wrote those Knowledge Base articles (http://support.microsoft.com/kb/328360/EN-US/) - maybe the same idiot who created "Web Server Extensions". But the same - adding extensions and enabling them may be achived much simplier: just open III Manager, go to "Web Server Extensions" and add what you need interactively.

I'm trying to make both PHP 4 and PHP 5 running as modules on my machine, PHP 4 under IIS and PHP 5 under Apache 2. It turns out that it much easier to work with Apache. In particular, it allows to use PHPIniDir directive to point PHP to php.ini file. IIS is supposed to allow it with setting the PHPRC environment variable, but for some reason it doesn't work on my machine so far.
barry dot fagin at usafa dot af dot mil
04-Jan-2005 06:22
Fixing 404 (file not found) errors with PHP 5.0.3 and IIS 6.0

IIS 6.0 is installed with security settings that don't permit dynamic content.  This means that even if all the hints in the FAQ are paid attention to (.ini modified correctly, security and permissions correct for IUSR_xxx user, etc), you still get 404 errors for all php files. 

To fix this:  IIS Manager -> expand local computer -> Web Services Extensions -> Add web service or extension -> .php, browse to c:\php\php-cgi.exe or wherever you had the php executable installed. That plus setting the doc_root in the .ini file solved the problem.

--BF
furrycod at hotmail dot com
07-Sep-2004 06:35
Great WAMP 1.4.4 (Apache 1.*, MySql 4.*, PHP 4.*) installation article at http://www.circaware.com/articles.php?id=2

This article details how to install these onto a USB stick--which means changing *nothing* on the host PC, such as registry entries, environment variables, files in the Windows path, NT services, ini files, etc.

The USB stick install seems awkward, but I installed WAMP to my harddrive using this article as a guide (essentially replacing E:\ with C:\), and it works fine.  No more trying to decide where the *real* php.ini or my.ini file is that needs to be changed.
masternuthin diespammer at yahoo dot com
24-Jun-2004 12:33
PHP 4.3.7.7 and IIS 6 (w2k3 standard)

Followed note from nigel dot salt at hotmail dot com
but had to modify "Script Map" to "ScriptMap"

Also, had to follow note from jimo at mail dot azhsv dot com

after all that - it worked.
jeff_graham at datacenterservices dot net
01-Feb-2004 10:51
As stated within the note "jimo at mail dot azhsv dot com
29-Nov-2003 04:33
PHP 4 and IIS 6.0 (Windows Server 2003)," I found the same steps were requiered for installation of PhP 5 beta 3 on my Windows 2003 server (Standard Edition)
nigel dot salt at hotmail dot com
14-Dec-2003 02:00
Finally got IIS 5 and PHP 5 to talk. 

What worked for me was:

1) Set
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
W3SVC\Parameters\Script Map]
".php"="your path to php\\php.exe"

2) ensure there is not a php.ini in the windows system folder and that there is one wherever you've put PHP

3) edit php.ini and set cgi force redirect to 0 and cgi.rfc2616_headers = 1

4) Put the PHP scripts in their own folder underneath the inetpub root

5) Open the IIS console, right click your new php folder
In the Directory tab
 set application name to the name of the folder
 set executable and script as permission
 set application protection to low
Click configuration and check that .php is mapped to wherever you put
PHP

Restart IIS

Try a very simple PHP page and it should work

Nigel
jimo at mail dot azhsv dot com
30-Nov-2003 04:33
PHP 4 and IIS 6.0 (Windows Server 2003)

Had difficulty getting PHP 4.3.3 to work with Win2003 Ent Server for use with SquirrelMail.  Problem found and believed solved.  Appears to be something New with IIS 6.0 (More security by Micro$oft)  Was getting 404 error and php was not being run as a cgi even though it was in extensions and IIS user had rights to execute it. (php from command line operated correctly)

If you are installing on Windows Server 2003 (only have Enterprise Edition Not sure if this applies to standard edition), and you have done the normal procedures for inclusion of PHP scripts (either ISAPI or CGI) in IIS, you will still get a 404 error when attempting to execute those scripts even though IIS has rights and the extension points to the correct file.  To alleviate this problem, perform the following:

1.    Open a command prompt window
2.    Change to C:\windows\system32
3.    Execute the command:  cscript  iisext.vbs /AddFile c:\php\php.exe 1 php 0 php
4.    Execute the command:  cscript iisext.vbs /EnFile c:\php\php.exe
5.    To check for correct execution of the above,
6.    Execute the command:  cscript IisExt.vbs /ListFile the php extension should be listed

If you try just step 4 without step 3 you get an error that the file is not in the list (and wont be there till you do step 3 above)

After this, IIS seems to like the php extension and work normally.

For additional reference, see the below 3 Micro$oft KB Articles:
HOWTO: Enable and Disable ISAPI Extensions and CGI Applications in IIS 6.0 (MS KB Article 328360)

HOWTO List Web Server Extensions and Extension Files in IIS 6.0 (MS KB Article 328505)

HOWTO Add and Remove Web Service Extension Files in IIS 6.0 (MS KB Article 328419)
peter dot mosinskisNOSPAM at csuci dot edu
06-Mar-2003 09:36
Running Win2K AS + IIS5.0 + PHP 4.3.1, I ran into a nasty problem that I mistakenly thought had to do with something in the php.ini configuration. When I would try to submit a form using the HTTP method GET it would work, but I would get a "404 Page Not Found" error using the POST method.

All my permissions were set correctly, the php.ini was configured correctly. It had to do with URLScan being installed on IIS (see below)

Page 404 File Not Found Error When Using POST method in PHP (and Perl, and otherwise)
-------------------------------------------

This is related to the Microsoft URLScan utility. If you have this problem, the IIS administrator has probably run the IIS Lockdown tool as well as configured URLScan to reject this type of HTTP method when sent in a URL. These tools are meant to enhance web server security.

URLScan configuration files can be found in the \WINNT\system32\inetsrv\urlscan folder on the web server. Specifically, the file to modify is urlscan.ini.

The changes to make are as follows:
1. Make sure UseAllowVerbs=1 under [options]
2. Under the [AllowVerbs] section, list your allowed HTTP methods to include:
    GET
    POST

For more information on the IIS Lockdown tool and URLScan, visit http://technet.microsoft.com
monroe at peoplego dot com
18-May-2002 07:32
INSTALLATION ON OPENBSD 3.1 VIA PORTS COLLECTION
Would have succeed but no mysql support.
I commented out the FLAVORS+= dbase filepro mysql mysql_bundled postgresql iodbc in the /usr/ports/www/php4/Makefile and in the configure options added 
--with-mysql=/usr/local   and it worked.

Good Luck
rodent at mighty dot co dot za
17-Apr-2002 01:46
On windows 2000 installation I've had PHP simply hanging when running a PHP script.

To see exactly what is going wrong with PHP in the context of the IUSR_MACHINENAME account create a shortcut on your desktop to point to cmd.exe.

Right click on the shortcut, and select properties.

Then check the 'run as a different user' checkbox of the property pages of the shortcut.

Double click then shortcut, and you will be prompted for a user account to run the cmd.exe shell under.

Enter IUSR_MACHINENAME (replace machine name with the machine name of your system), and enter the password for the account.

If you don't know the password for the IUSR account you might need to go change it in Administrative Tools->Computer Management.

Enter the password, and you will be dropped into a command prompt.

Now run c:\php\php.exe -i and see if you can catch any error messages.

On my system it had a problem accessing c:\winnt\system32\browscap.ini which I was then able to sort out.

Running PHP as the Administrator user didn't give this problem, so being able to impersonate the IIS account was a very useful diagnostic tool.
tanis22 at hotmail dot com
13-Nov-2001 08:01
I figured out why i get this error with just a virtual directory and not the root:

8. Windows: I have installed PHP, but when I to access a PHP script file via my browser, I get the error: cgi error:
 The specified CGI application misbehaved by not
 returning a complete set of HTTP headers.
 The headers it did return are:
---------------------
Look at the php.ini file and look for

doc_root =

set it to nothing so that it does not only look for that directory. I hope it helps people with IIS and PHP
rggonzalez at iname dot com
10-Nov-2000 02:40
Notes on installing PHP (3.x.x or 4.x.x) on a RedHat 6.x Linux box using glibc 2.1.x. When you install it as a DSO  module for Apache (--with-apxs) with the standard RPM's from RedHat for Apache and MySQL, the httpd daemon dies without giving any error message, and without sending any message to the console.

From a comment by Rasmus Ledorf: this is caused "probably due to a glibc-2.1.x bug related to dynamically loading a library
linked against pthreads into a binary that isn't linked against
pthreads.  Try it using --without-mysql and see if it works.  If it does
then you know it is a mysql-related problem.  To fix it you will need the
non-threaded mysql client rpm available from www.mysql.com".

You can also download the source code for MySQL and recompiled it statically, using this configuration options:

 --with-client-ldflags=-all-static
 --with-mysqld-ldflags=-all-static

You must then re-run the ./configure; make; make install in your PHP source tree to get the PHP shared module working with the new MySQL support.

Regards,
Rodolfo Gonzalez.
rggonzalez@iname.com
fischer_dj at mailcity dot com
24-Aug-2000 06:29
I've added detailed PWS, Perl, & PHP4 installation instructions for Win98 at FAQts.

http://www.faqts.com/knowledge-base/view.phtml/aid/5495/fid/336/lang/en

Problemas de Compilación> <Problemas con bases de datos
Last updated: Fri, 11 Apr 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites