My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Showing posts with label httpd. Show all posts
Showing posts with label httpd. Show all posts

Sunday, February 15, 2026

how to check apache server and php installed or not on mac

 macOS comes with Apache pre-installed, though it may not be enabled by default. You can check its installation and status using the Terminal with the following commands:

  • Check the Apache version: Running the apachectl -v command will display the installed Apache version and build date, which confirms the software is present.
    bash
    apachectl -v
    
  • Check if the Apache service is running: Use sudo apachectl status to see the current status of the Apache service. You can also use the ps aux | grep httpd command to list all running processes related to Apache's executable (httpd).
    bash
    sudo apachectl status
    # or
    ps aux | grep httpd
    
  • Verify the installation via web browser: If the service is running, open a web browser and navigate to http://localhost. If you see the message "It works!", then Apache is installed and serving web pages correctly.
  • Locate the Apache binary: The which command can show the location of the Apache executable in your system's PATH, which is typically /usr/sbin/httpd for the default macOS installation.
    bash
    which httpd
    # or
    whereis httpd
    
If these commands do not work, Apache may not be correctly configured or installed on your system. In such cases, you might consider installing it via a package manager like Homebrew.