0

Debido a problemas expuestos en mis publicaciones anteriores, decidí dejar de usar Xampp y hacer una instalación normal de Apache y PHP; seguí todos los tutoriales que pude. Logré hacer que funcione el apache, y logré que el php sea reconocido por mi pc; lo que todavía no logro, es hacer que el Apache use el PHP para que lea el código y lo convierta en pagina, ya que aparece mi pagina en fondo blanco con el lenguaje escrito.

Como uso PHP 7.4, y está instalado en c:\php, seguí la instrucción de modificar el archivo de apache httpd.confy añadir las siguientes lineas:

PHPIniDir "C:/php"
AddHandler application/x-httpd-php .php
LoadModule php7_module "C:/php/php7apache2_4.dll"

Despues de eso, al intentar encender el servicio, me sale el error:

error de apache

pero cuando retiro la linea mencionada antes, vuelve a funcionar el apache, aunque sin el php todavía.

Edit: adjunto la información de los archivos logs:

access.log:

192.168.1.8 - - [05/Mar/2021:11:38:30 -0500] "GET /vdb/d.php HTTP/1.1" 304 -
192.168.1.8 - - [05/Mar/2021:11:38:30 -0500] "GET /favicon.ico HTTP/1.1" 404 196
192.168.1.8 - - [05/Mar/2021:11:39:30 -0500] "-" 408 -
::1 - - [05/Mar/2021:13:41:18 -0500] "GET /favicon.ico HTTP/1.1" 404 196
::1 - - [05/Mar/2021:13:41:58 -0500] "GET /index.php HTTP/1.1" 200 65
::1 - - [05/Mar/2021:13:42:58 -0500] "-" 408 -
192.168.1.8 - - [05/Mar/2021:14:19:46 -0500] "GET /favicon.ico HTTP/1.1" 404 196
192.168.1.8 - - [05/Mar/2021:14:20:46 -0500] "-" 408 -

error.log:

[Fri Mar 05 11:38:23.388972 2021] [mpm_winnt:notice] [pid 6056:tid 624] AH00455: Apache/2.4.46 (Win64) configured -- resuming normal operations
[Fri Mar 05 11:38:23.388972 2021] [mpm_winnt:notice] [pid 6056:tid 624] AH00456: Apache Lounge VS16 Server built: Feb 17 2021 13:11:14
[Fri Mar 05 11:38:23.388972 2021] [core:notice] [pid 6056:tid 624] AH00094: Command line: 'C:\\Apache\\bin\\httpd.exe -d C:/Apache'
[Fri Mar 05 11:38:23.388972 2021] [mpm_winnt:notice] [pid 6056:tid 624] AH00418: Parent: Created child process 3284
[Fri Mar 05 11:38:23.600491 2021] [mpm_winnt:notice] [pid 3284:tid 564] AH00354: Child: Starting 64 worker threads.
[Fri Mar 05 11:44:51.669664 2021] [mpm_winnt:notice] [pid 6056:tid 624] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Mar 05 11:44:53.671234 2021] [mpm_winnt:notice] [pid 3284:tid 564] AH00364: Child: All worker threads have exited.
[Fri Mar 05 11:44:53.688592 2021] [mpm_winnt:notice] [pid 6056:tid 624] AH00430: Parent: Child process 3284 exited successfully.
[Fri Mar 05 11:46:51.230831 2021] [mpm_winnt:notice] [pid 2956:tid 644] AH00455: Apache/2.4.46 (Win64) configured -- resuming normal operations
[Fri Mar 05 11:46:51.230831 2021] [mpm_winnt:notice] [pid 2956:tid 644] AH00456: Apache Lounge VS16 Server built: Feb 17 2021 13:11:14
[Fri Mar 05 11:46:51.230831 2021] [core:notice] [pid 2956:tid 644] AH00094: Command line: 'C:\\Apache\\bin\\httpd.exe -d C:/Apache'
[Fri Mar 05 11:46:51.230831 2021] [mpm_winnt:notice] [pid 2956:tid 644] AH00418: Parent: Created child process 7112
[Fri Mar 05 11:46:51.418315 2021] [mpm_winnt:notice] [pid 7112:tid 544] AH00354: Child: Starting 64 worker threads.
[Fri Mar 05 12:52:44.642994 2021] [mpm_winnt:notice] [pid 2956:tid 644] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Mar 05 12:52:46.644304 2021] [mpm_winnt:notice] [pid 7112:tid 544] AH00364: Child: All worker threads have exited.
[Fri Mar 05 12:52:46.656491 2021] [mpm_winnt:notice] [pid 2956:tid 644] AH00430: Parent: Child process 7112 exited successfully.
[Fri Mar 05 13:09:35.465629 2021] [mpm_winnt:notice] [pid 8648:tid 628] AH00455: Apache/2.4.46 (Win64) configured -- resuming normal operations
[Fri Mar 05 13:09:35.465629 2021] [mpm_winnt:notice] [pid 8648:tid 628] AH00456: Apache Lounge VS16 Server built: Feb 17 2021 13:11:14
[Fri Mar 05 13:09:35.465629 2021] [core:notice] [pid 8648:tid 628] AH00094: Command line: 'C:\\Apache\\bin\\httpd.exe -d C:/Apache'
[Fri Mar 05 13:09:35.465629 2021] [mpm_winnt:notice] [pid 8648:tid 628] AH00418: Parent: Created child process 9320
[Fri Mar 05 13:09:35.653084 2021] [mpm_winnt:notice] [pid 9320:tid 556] AH00354: Child: Starting 64 worker threads.
[Fri Mar 05 14:19:37.088085 2021] [mpm_winnt:notice] [pid 8648:tid 628] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Mar 05 14:19:39.090832 2021] [mpm_winnt:notice] [pid 9320:tid 556] AH00364: Child: All worker threads have exited.
[Fri Mar 05 14:19:39.107620 2021] [mpm_winnt:notice] [pid 8648:tid 628] AH00430: Parent: Child process 9320 exited successfully.
[Fri Mar 05 14:19:39.822045 2021] [mpm_winnt:notice] [pid 6796:tid 628] AH00455: Apache/2.4.46 (Win64) configured -- resuming normal operations
[Fri Mar 05 14:19:39.822045 2021] [mpm_winnt:notice] [pid 6796:tid 628] AH00456: Apache Lounge VS16 Server built: Feb 17 2021 13:11:14
[Fri Mar 05 14:19:39.822045 2021] [core:notice] [pid 6796:tid 628] AH00094: Command line: 'C:\\Apache\\bin\\httpd.exe -d C:/Apache'
[Fri Mar 05 14:19:39.824071 2021] [mpm_winnt:notice] [pid 6796:tid 628] AH00418: Parent: Created child process 2384
[Fri Mar 05 14:19:40.010732 2021] [mpm_winnt:notice] [pid 2384:tid 544] AH00354: Child: Starting 64 worker threads.
[Fri Mar 05 14:24:58.102765 2021] [mpm_winnt:notice] [pid 6796:tid 628] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Fri Mar 05 14:25:00.103720 2021] [mpm_winnt:notice] [pid 2384:tid 544] AH00364: Child: All worker threads have exited.
[Fri Mar 05 14:25:00.121685 2021] [mpm_winnt:notice] [pid 6796:tid 628] AH00430: Parent: Child process 2384 exited successfully.

install.log:

Installing Apache HTTP Server 2.x with
 DomainName    = example.com
 ServerName    = www.example.com
 ServerAdmin   = [email protected]
 ServerPort    = 80
 ServerSslPort = 443
 ServerRoot    = c:/Apache24
Rewrote docs/conf/extra/httpd-autoindex.conf.in
 to c:/Apache24/conf/original/extra/httpd-autoindex.conf
Rewrote docs/conf/extra/httpd-default.conf.in
 to c:/Apache24/conf/original/extra/httpd-default.conf
Rewrote docs/conf/extra/httpd-ssl.conf.in
 to c:/Apache24/conf/original/extra/httpd-ssl.conf
Rewrote docs/conf/extra/httpd-multilang-errordoc.conf.in
 to c:/Apache24/conf/original/extra/httpd-multilang-errordoc.conf
Rewrote docs/conf/extra/httpd-info.conf.in
 to c:/Apache24/conf/original/extra/httpd-info.conf
Rewrote docs/conf/extra/httpd-userdir.conf.in
 to c:/Apache24/conf/original/extra/httpd-userdir.conf
Rewrote docs/conf/extra/httpd-mpm.conf.in
 to c:/Apache24/conf/original/extra/httpd-mpm.conf
Rewrote docs/conf/httpd.conf.in
 to c:/Apache24/conf/original/httpd.conf
Rewrote docs/conf/extra/proxy-html.conf.in
 to c:/Apache24/conf/original/extra/proxy-html.conf
Rewrote docs/conf/extra/httpd-vhosts.conf.in
 to c:/Apache24/conf/original/extra/httpd-vhosts.conf
Rewrote docs/conf/extra/httpd-dav.conf.in
 to c:/Apache24/conf/original/extra/httpd-dav.conf
Rewrote docs/conf/extra/httpd-languages.conf.in
 to c:/Apache24/conf/original/extra/httpd-languages.conf
Rewrote docs/conf/extra/httpd-manual.conf.in
 to c:/Apache24/conf/original/extra/httpd-manual.conf
Duplicated c:/Apache24/conf/original/extra/httpd-autoindex.conf
 to c:/Apache24/conf/extra/httpd-autoindex.conf
Duplicated c:/Apache24/conf/original/extra/httpd-default.conf
 to c:/Apache24/conf/extra/httpd-default.conf
Duplicated c:/Apache24/conf/original/extra/httpd-ssl.conf
 to c:/Apache24/conf/extra/httpd-ssl.conf
Duplicated c:/Apache24/conf/original/extra/httpd-multilang-errordoc.conf
 to c:/Apache24/conf/extra/httpd-multilang-errordoc.conf
Duplicated c:/Apache24/conf/original/extra/httpd-info.conf
 to c:/Apache24/conf/extra/httpd-info.conf
Duplicated c:/Apache24/conf/original/extra/httpd-userdir.conf
 to c:/Apache24/conf/extra/httpd-userdir.conf
Duplicated c:/Apache24/conf/original/extra/httpd-mpm.conf
 to c:/Apache24/conf/extra/httpd-mpm.conf
Duplicated c:/Apache24/conf/original/httpd.conf
 to c:/Apache24/conf/httpd.conf
Duplicated c:/Apache24/conf/original/magic
 to c:/Apache24/conf/magic
Duplicated c:/Apache24/conf/original/charset.conv
 to c:/Apache24/conf/charset.conv
Duplicated c:/Apache24/conf/original/extra/proxy-html.conf
 to c:/Apache24/conf/extra/proxy-html.conf
Duplicated c:/Apache24/conf/original/extra/httpd-vhosts.conf
 to c:/Apache24/conf/extra/httpd-vhosts.conf
Duplicated c:/Apache24/conf/original/extra/httpd-dav.conf
 to c:/Apache24/conf/extra/httpd-dav.conf
Duplicated c:/Apache24/conf/original/mime.types
 to c:/Apache24/conf/mime.types
Duplicated c:/Apache24/conf/original/extra/httpd-languages.conf
 to c:/Apache24/conf/extra/httpd-languages.conf
Duplicated c:/Apache24/conf/original/extra/httpd-manual.conf
 to c:/Apache24/conf/extra/httpd-manual.conf
11
  • Y qué sale en los logs de apache? La DLL está en esa ruta?
    – Alfabravo
    el 5 mar. 2021 a las 20:35
  • @Alfabravo disculpe no entiendo su pregunta, hay una carpeta llamado "logs" con tres archivos ahi, ¿que hago con eso? el 5 mar. 2021 a las 20:46
  • leerlos y ver qué sale a la hora que intentaste iniciar apache
    – Alfabravo
    el 5 mar. 2021 a las 20:58
  • @Alfabravo ya edité la publicación con la información que pidió el 5 mar. 2021 a las 21:08
  • Creo que el problema original se hubiera resuelto fácilmente con algunas configuraciones en el Firewall y la instalación de todos los servicios por separado solo va a complicar más las cosas.
    – Triby
    el 5 mar. 2021 a las 22:06

1 respuesta 1

0

Qué tal compañero, este error se puede deber a dos situaciones:

  1. Puertos ocupados, Windows Server o Enterprise tiene instalado por defecto su propio servidor (IIS) o puede que lo hayas instalado alguna vez, deberías de cambiar el puerto de Listen en el archivo "httpd.conf" a 8080 u otro que no utilice ningún servicio igual que el puerto 443 a 4433, esto en el archivo "httpd-ssl.conf".

  2. Faltan configuraciones en tu archivo "httpd.conf", en donde inicia la carga de módulos "LoadModule" debes de colocar las siguientes líneas:

LoadModule php_module C:/php/php7apache2_4.dll
<IfModule php_module>
    AddHandler application/x-httpd-php .php
    PHPIniDir "C:/php"
</IfModule>

Así le indicas lo que ya estabas tratando de realizar con las líneas que insertaste pero en el formato que lo pude las versiones nuevas de PHP. Si no te llega a funcionar ponle el número (7):

LoadModule php7_module C:/php/php7apache2_4.dll
<IfModule php7_module>
    AddHandler application/x-httpd-php .php
    PHPIniDir "C:/php"
</IfModule>

Saludos y éxitos!

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.