skip to Main Content

Have read previous answers and understand that I must have two versions installed, but cannot locate where the 5.6 could be. I changed /etc/bin/php to point to the version 7.3 I installed using brew. I updated the /etc/apache2/httpd.conf to use [email protected]. I restarted the server to be sure it would start apache reading from the httpd.conf. Yet, when I run phpinfo from the webpage, It starts with 5.6 and does not include the http.conf info about the server administrator, yet it says it’s using http.conf. For some reason sudo apachectl restart will not work saying that the port is already in use. I removed the /usr/local/php5 link ( renamed it to php5.bak ), so that it would not be used.

What other things should I look at?

3

Answers


  1. Chosen as BEST ANSWER

    I have found a "partial" answer. I am running Mac OS X 10.12.6 on a mac-mini as a web server. The location of the configuration file for apache is:

    /Library/Server/web/config/apache2/httpd_server_app.conf
    

    Thus all of the /etc/apache2/httpd.conf and other suggestions, while they work fine on many unix and even OS X ( non-server ) where one has used brew to install, they don't work here. I made some changes in the above file and verified that AFTER going to the Server app, selecting WebSites in the services menu, and clicking toggling the ON/OFF button to off, then back to on, the server is restarted. All of the attempts using different apache2ctl restart, etc. do not work.

    I am still somewhat puzzled that I don't see the server administrator that I enter showing up in the phpinfo.php display, but some other changes did.

    My next quest, and suggestions are welcome, is how to change the http_server_app.conf file so that instead of php5, it will use my php7 that is available from the command line. The attempt to change:

    LoadModule php5_module libexec/apache2/libphp5.so
    #LoadModule php7_module libexec/apache2/libphp7.so
    

    did not work as libphp7.so could not be located. I'm now looking for it. At one point in the conference file, I find:

    <IfModule php5_module>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
        <IfModule dir_module>
            DirectoryIndex index.html index.php
        </IfModule>
    </IfModule>
    

    Will I need to have one like this for php7_module, once I find it and use it above?


  2. When you use php -v command you use php-cli which can be diffrent version.
    Also if you have multiple versions installed you may want disable apache module for old one.

    sudo a2dismod php5 // disable php5.6
    sudo a2enmod php7.3 // enable php7.3
    
    Login or Signup to reply.
  3. There can be many different things that are causing it but I’m betting on MacOS Apache that’s installed with the system. Try killing it from the startup:

    sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search