osx - Apache on Mac OS Sierra: Illegal instruction: 4 $HTTPD -


background

i followed instructions here configure apache, php, , mysql on mac (running sierra 10.12.4) , got working fine. used migration assistant copy on new mac (mac #2) developer use. on first login, opened chrome , visited localhost. did not make changes mac #2 beforehand.

the problem

on mac #2, when visit localhost in chrome, err_connection_refused (this site can't reached: localhost refused connect). digging led me this q/a on apple stack exchange, tried following in terminal:

  • ping 127.0.0.1 (success; i.e., "64 bytes 127.0.0.1...")
  • ping localhost (success)
  • ping myvirtualhost.dev (success)

the plot thicks

i tried run apachectl configtest, threw following error:

  • /usr/local/bin/apachectl: line 79: 1132 illegal instruction: 4 $httpd -t

ok, how sudo apachectl -k restart? nope, same error:

  • /usr/local/bin/apachectl: line 79: 1170 illegal instruction: 4 $httpd "$@"

omitting -k flag throws same error, last characters bit different:

  • /usr/local/bin/apachectl: line 79: 1184 illegal instruction: 4 $httpd -k $argv

what i've tried

i can't stop, start, restart, or apache. google searching error doesn't bring much. i've tried restoring httpd.conf backup had, restarting computer. checked /etc/hosts , looks normal. i'm not sure else do.

apache's config messed somehow i'm not sure where. should do?

other potentially useful info

running httpd -v in terminal yields:

  • server version: apache/2.4.25 (unix)

typing php -v in terminal yielded:

  • illegal instruction: 4

so reinstalled , php -v yields:

  • php 5.6.30 (cli) (built: apr 7 2017 13:12:17)

typing which php yields:

  • /usr/local/bin/php

in case, had php binary loaded in 'other' conf file:

try running:

sudo mv /private/etc/apache2/other/+php-osx.conf /private/etc/apache2/other/+php-osx.conf-bak

and restart apache

if don't have conf file, php binary being loaded on system causing issue because error similar saw.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -