La primera vez que obtuve un nuevo MBP 2016. Intentando configurar PHP, MySQL y Apache. Inició Apache usando el comando
sudo apachectl restartLuego instaló PHP por
brew install php71 --with-httpd24También hice los siguientes cambios...
# # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. # DirectoryIndex index.html index.php SetHandler application/x-httpd-php ServerName dev-server Además, actualizó lo mismo en el archivo host /etc/hosts/
Pero, cada vez que intento detener/reiniciar mi apache usando el comando sudo apachectl restart o sudo apachectl stop , obtengo los siguientes errores.
AH00557: httpd: apr_sockaddr_info_get() failed for Sureshs-MacBook-Pro.local AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message httpd not running, trying to start Pero, extrañamente, cuando ejecuto cualquier archivo PHP desde mi navegador http://localhost/index.php , funciona bien. Como en mi archivo index.php, estoy usando el código <?php phpinfo(); ?> Muestra la versión de PHP Version 7.1.4 cargada.
Intenté mucho, pero no tengo idea de qué está fallando en dónde.
---ACTUALIZAR---
Después de actualizar 127.0.0.1 Sureshs-MacBook-Pro.local en mi /private/etc/hosts , se resolvió un error. Ahora recibo solo un error a continuación.
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using Sureshs-MacBook-Pro.local. Set the 'ServerName' directive globally to suppress this messageFinalmente, resolví esto actualizando ServerName localhost:8080 en el archivo /usr/local/etc/apache2/2.4/httpd.conf . Era un archivo httpd.conf diferente que no conocía.
Además, para Apache start/restart/stop el siguiente comando sudo /usr/sbin/apachectl start funciona para mí.
Según mensaje:
Configure la directiva 'ServerName' globalmente para suprimir este mensaje.
Debe identificar el archivo de configuración de Apache httpd.conf mediante:
apachectl -t -D DUMP_INCLUDES luego edítelo y descomente la línea con ServerName (asegúrese de que tenga el nombre de servidor válido). P.ej
ServerName localhostabrir archivo httpd.conf
vi /etc/httpd/conf/httpd.confañadir a la primera línea
ServerName localhostsystemctl reiniciar httpd