No Apache process after restart in MoJave












0















I installed MoJave from Sierra and can't get apache to work,



I expect it to serve /Library/WebServer/Documents/index.html



-rw-r--r--    1 root  wheel    114 Jan  1 21:32 index.html


When I try to restart the server with,



$ sudo apachectl restart


and just in case with,



$ sudo /usr/sbin/apachectl restart


I get,



/System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded


But does 'loaded' mean 'running'?



Also there is no httpd process running,



$ ps aux | grep httpd


returns nothing.



And naturally when I navigate to localhost in the browser I get 'site can't be reached'.



I am running the default /etc/apache2/httpd.conf



I used the -k to like this,



$ sudo /usr/sbin/apachectl -k restart


and this gave,



httpd: Syntax error on line 546 of /private/etc/apache2/httpd.conf: Syntax error on line 8 of /private/etc/apache2/other/+php-osx.conf: Cannot load /usr/local/php5/libphp7.so into server: dlopen(/usr/local/php5/libphp7.so, 10): no suitable image found.  Did find:nt/usr/local/php5/libphp7.so: code signature in (/usr/local/php5/libphp7.so) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.nt/usr/local/php5/libphp7.so: stat() failed with errno=22


Update



Then I went to,



/private/etc/apache2/other/+php-osx.conf


and commented out,



#LoadModule php7_module        /usr/local/php5/libphp7.so

Now at least localhost/index.html works but I presume this disables index.php which is in the same place as index.html. The php code in index.php shows, it does not execute php.


I think this tutoral might help,



https://coolestguidesontheplanet.com/install-apache-mysql-php-on-macos-mojave-10-14/



Any help would be greatly appreciated,



Thanks










share|improve this question




















  • 1





    Also, looks like duplicate of this question: stackoverflow.com/questions/48320702/…

    – Ivan Gurzhiy
    Jan 2 at 20:29











  • Thanks but there is no solution there other than a suggestion.

    – Shane G
    Jan 2 at 20:48











  • I tried the solution also and it is not working, thanks

    – Shane G
    Jan 2 at 20:51
















0















I installed MoJave from Sierra and can't get apache to work,



I expect it to serve /Library/WebServer/Documents/index.html



-rw-r--r--    1 root  wheel    114 Jan  1 21:32 index.html


When I try to restart the server with,



$ sudo apachectl restart


and just in case with,



$ sudo /usr/sbin/apachectl restart


I get,



/System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded


But does 'loaded' mean 'running'?



Also there is no httpd process running,



$ ps aux | grep httpd


returns nothing.



And naturally when I navigate to localhost in the browser I get 'site can't be reached'.



I am running the default /etc/apache2/httpd.conf



I used the -k to like this,



$ sudo /usr/sbin/apachectl -k restart


and this gave,



httpd: Syntax error on line 546 of /private/etc/apache2/httpd.conf: Syntax error on line 8 of /private/etc/apache2/other/+php-osx.conf: Cannot load /usr/local/php5/libphp7.so into server: dlopen(/usr/local/php5/libphp7.so, 10): no suitable image found.  Did find:nt/usr/local/php5/libphp7.so: code signature in (/usr/local/php5/libphp7.so) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.nt/usr/local/php5/libphp7.so: stat() failed with errno=22


Update



Then I went to,



/private/etc/apache2/other/+php-osx.conf


and commented out,



#LoadModule php7_module        /usr/local/php5/libphp7.so

Now at least localhost/index.html works but I presume this disables index.php which is in the same place as index.html. The php code in index.php shows, it does not execute php.


I think this tutoral might help,



https://coolestguidesontheplanet.com/install-apache-mysql-php-on-macos-mojave-10-14/



Any help would be greatly appreciated,



Thanks










share|improve this question




















  • 1





    Also, looks like duplicate of this question: stackoverflow.com/questions/48320702/…

    – Ivan Gurzhiy
    Jan 2 at 20:29











  • Thanks but there is no solution there other than a suggestion.

    – Shane G
    Jan 2 at 20:48











  • I tried the solution also and it is not working, thanks

    – Shane G
    Jan 2 at 20:51














0












0








0








I installed MoJave from Sierra and can't get apache to work,



I expect it to serve /Library/WebServer/Documents/index.html



-rw-r--r--    1 root  wheel    114 Jan  1 21:32 index.html


When I try to restart the server with,



$ sudo apachectl restart


and just in case with,



$ sudo /usr/sbin/apachectl restart


I get,



/System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded


But does 'loaded' mean 'running'?



Also there is no httpd process running,



$ ps aux | grep httpd


returns nothing.



And naturally when I navigate to localhost in the browser I get 'site can't be reached'.



I am running the default /etc/apache2/httpd.conf



I used the -k to like this,



$ sudo /usr/sbin/apachectl -k restart


and this gave,



httpd: Syntax error on line 546 of /private/etc/apache2/httpd.conf: Syntax error on line 8 of /private/etc/apache2/other/+php-osx.conf: Cannot load /usr/local/php5/libphp7.so into server: dlopen(/usr/local/php5/libphp7.so, 10): no suitable image found.  Did find:nt/usr/local/php5/libphp7.so: code signature in (/usr/local/php5/libphp7.so) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.nt/usr/local/php5/libphp7.so: stat() failed with errno=22


Update



Then I went to,



/private/etc/apache2/other/+php-osx.conf


and commented out,



#LoadModule php7_module        /usr/local/php5/libphp7.so

Now at least localhost/index.html works but I presume this disables index.php which is in the same place as index.html. The php code in index.php shows, it does not execute php.


I think this tutoral might help,



https://coolestguidesontheplanet.com/install-apache-mysql-php-on-macos-mojave-10-14/



Any help would be greatly appreciated,



Thanks










share|improve this question
















I installed MoJave from Sierra and can't get apache to work,



I expect it to serve /Library/WebServer/Documents/index.html



-rw-r--r--    1 root  wheel    114 Jan  1 21:32 index.html


When I try to restart the server with,



$ sudo apachectl restart


and just in case with,



$ sudo /usr/sbin/apachectl restart


I get,



/System/Library/LaunchDaemons/org.apache.httpd.plist: service already loaded


But does 'loaded' mean 'running'?



Also there is no httpd process running,



$ ps aux | grep httpd


returns nothing.



And naturally when I navigate to localhost in the browser I get 'site can't be reached'.



I am running the default /etc/apache2/httpd.conf



I used the -k to like this,



$ sudo /usr/sbin/apachectl -k restart


and this gave,



httpd: Syntax error on line 546 of /private/etc/apache2/httpd.conf: Syntax error on line 8 of /private/etc/apache2/other/+php-osx.conf: Cannot load /usr/local/php5/libphp7.so into server: dlopen(/usr/local/php5/libphp7.so, 10): no suitable image found.  Did find:nt/usr/local/php5/libphp7.so: code signature in (/usr/local/php5/libphp7.so) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.nt/usr/local/php5/libphp7.so: stat() failed with errno=22


Update



Then I went to,



/private/etc/apache2/other/+php-osx.conf


and commented out,



#LoadModule php7_module        /usr/local/php5/libphp7.so

Now at least localhost/index.html works but I presume this disables index.php which is in the same place as index.html. The php code in index.php shows, it does not execute php.


I think this tutoral might help,



https://coolestguidesontheplanet.com/install-apache-mysql-php-on-macos-mojave-10-14/



Any help would be greatly appreciated,



Thanks







macos apache






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 22:51







Shane G

















asked Jan 2 at 19:49









Shane GShane G

98911740




98911740








  • 1





    Also, looks like duplicate of this question: stackoverflow.com/questions/48320702/…

    – Ivan Gurzhiy
    Jan 2 at 20:29











  • Thanks but there is no solution there other than a suggestion.

    – Shane G
    Jan 2 at 20:48











  • I tried the solution also and it is not working, thanks

    – Shane G
    Jan 2 at 20:51














  • 1





    Also, looks like duplicate of this question: stackoverflow.com/questions/48320702/…

    – Ivan Gurzhiy
    Jan 2 at 20:29











  • Thanks but there is no solution there other than a suggestion.

    – Shane G
    Jan 2 at 20:48











  • I tried the solution also and it is not working, thanks

    – Shane G
    Jan 2 at 20:51








1




1





Also, looks like duplicate of this question: stackoverflow.com/questions/48320702/…

– Ivan Gurzhiy
Jan 2 at 20:29





Also, looks like duplicate of this question: stackoverflow.com/questions/48320702/…

– Ivan Gurzhiy
Jan 2 at 20:29













Thanks but there is no solution there other than a suggestion.

– Shane G
Jan 2 at 20:48





Thanks but there is no solution there other than a suggestion.

– Shane G
Jan 2 at 20:48













I tried the solution also and it is not working, thanks

– Shane G
Jan 2 at 20:51





I tried the solution also and it is not working, thanks

– Shane G
Jan 2 at 20:51












1 Answer
1






active

oldest

votes


















1














To check your Apache config, you can also run:



apachectl configtest


You already commented the line causing Apache not to start. From here, you can add PHP to your Apache config this way:



First, locate your httpd.conf file path:



httpd -V | grep SERVER_CONFIG_FILE


You may also check with:



apachectl -t -D DUMP_INCLUDES


Then, open your httpd.conf file and try to look for a line starting with LoadModule php



If there's one comment it with #, If there's no such line, that's fine.



Just add the following line (for php7):



LoadModule php7_module path


or, for php5:



LoadModule php5_module path


and replace path with the result of the find command below (if you have several results, choose the path you want to be used with Apache, that is, the version you want):



find /usr/libexec /usr/local/ -type f -name "libphp*"


Finally, restart Apache: sudo apachectl restart






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54012302%2fno-apache-process-after-restart-in-mojave%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    To check your Apache config, you can also run:



    apachectl configtest


    You already commented the line causing Apache not to start. From here, you can add PHP to your Apache config this way:



    First, locate your httpd.conf file path:



    httpd -V | grep SERVER_CONFIG_FILE


    You may also check with:



    apachectl -t -D DUMP_INCLUDES


    Then, open your httpd.conf file and try to look for a line starting with LoadModule php



    If there's one comment it with #, If there's no such line, that's fine.



    Just add the following line (for php7):



    LoadModule php7_module path


    or, for php5:



    LoadModule php5_module path


    and replace path with the result of the find command below (if you have several results, choose the path you want to be used with Apache, that is, the version you want):



    find /usr/libexec /usr/local/ -type f -name "libphp*"


    Finally, restart Apache: sudo apachectl restart






    share|improve this answer




























      1














      To check your Apache config, you can also run:



      apachectl configtest


      You already commented the line causing Apache not to start. From here, you can add PHP to your Apache config this way:



      First, locate your httpd.conf file path:



      httpd -V | grep SERVER_CONFIG_FILE


      You may also check with:



      apachectl -t -D DUMP_INCLUDES


      Then, open your httpd.conf file and try to look for a line starting with LoadModule php



      If there's one comment it with #, If there's no such line, that's fine.



      Just add the following line (for php7):



      LoadModule php7_module path


      or, for php5:



      LoadModule php5_module path


      and replace path with the result of the find command below (if you have several results, choose the path you want to be used with Apache, that is, the version you want):



      find /usr/libexec /usr/local/ -type f -name "libphp*"


      Finally, restart Apache: sudo apachectl restart






      share|improve this answer


























        1












        1








        1







        To check your Apache config, you can also run:



        apachectl configtest


        You already commented the line causing Apache not to start. From here, you can add PHP to your Apache config this way:



        First, locate your httpd.conf file path:



        httpd -V | grep SERVER_CONFIG_FILE


        You may also check with:



        apachectl -t -D DUMP_INCLUDES


        Then, open your httpd.conf file and try to look for a line starting with LoadModule php



        If there's one comment it with #, If there's no such line, that's fine.



        Just add the following line (for php7):



        LoadModule php7_module path


        or, for php5:



        LoadModule php5_module path


        and replace path with the result of the find command below (if you have several results, choose the path you want to be used with Apache, that is, the version you want):



        find /usr/libexec /usr/local/ -type f -name "libphp*"


        Finally, restart Apache: sudo apachectl restart






        share|improve this answer













        To check your Apache config, you can also run:



        apachectl configtest


        You already commented the line causing Apache not to start. From here, you can add PHP to your Apache config this way:



        First, locate your httpd.conf file path:



        httpd -V | grep SERVER_CONFIG_FILE


        You may also check with:



        apachectl -t -D DUMP_INCLUDES


        Then, open your httpd.conf file and try to look for a line starting with LoadModule php



        If there's one comment it with #, If there's no such line, that's fine.



        Just add the following line (for php7):



        LoadModule php7_module path


        or, for php5:



        LoadModule php5_module path


        and replace path with the result of the find command below (if you have several results, choose the path you want to be used with Apache, that is, the version you want):



        find /usr/libexec /usr/local/ -type f -name "libphp*"


        Finally, restart Apache: sudo apachectl restart







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 3:56









        YoricYoric

        1,2102810




        1,2102810
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54012302%2fno-apache-process-after-restart-in-mojave%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith