Apache can't load PHP unsigned extensions on Mac OS Mojave











up vote
3
down vote

favorite
1












After upgrading to MacOS Mojave, Apache can't load PHP extensions anymore. With any extension I get the error below on the Apache log; it seems that Apple implemented Library Validation through Apache on MacOS Mojave. That makes it apparently impossible to load unsigned binaries with Apache.



Is there any workaround that would not involve to disable MacOS's SIP?




Failed loading //usr/local/php/extensions/xdebug.so:  dlopen(//usr/local/php/extensions/xdebug.so, 9): no suitable image found.  Did find:
//usr/local/php/extensions/xdebug.so: code signature in =(//usr/local/php/extensions/xdebug.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.
//usr/local/php/extensions/xdebug.so: stat() failed with errno=22











share|improve this question




















  • 1




    See this thread for workarounds: (1) Install apache and php from homebrew (answer by suneet64), (2) Add to /etc/apache2/httpd.conf the line LoadModule php7_module libexec/apache2/libphp7.so at the end, (3) Still in /etc/apache2/httpd.conf uncomment line 545 that says Include /private/etc/apache2/other/*.conf. Let me know if one or more of them solved the problem and I will add a more detailed answer.
    – harrymc
    Oct 1 at 20:22












  • same problem here with dispatcher-apache2.4-4.2.0.so
    – daVe
    Oct 2 at 8:39










  • @harrymc Thanks for the suggestion, but is there any other workaround that does not involve having to install a new instance of apache / php ?
    – delphirules
    Oct 2 at 13:46










  • The above workarounds are independent. Try number (2) and (3) and wait with (1) until you decide to try it.
    – harrymc
    Oct 2 at 14:15










  • @harrymc Should i do 2 AND 3, or only 2 or 3 ?
    – delphirules
    Oct 2 at 15:42















up vote
3
down vote

favorite
1












After upgrading to MacOS Mojave, Apache can't load PHP extensions anymore. With any extension I get the error below on the Apache log; it seems that Apple implemented Library Validation through Apache on MacOS Mojave. That makes it apparently impossible to load unsigned binaries with Apache.



Is there any workaround that would not involve to disable MacOS's SIP?




Failed loading //usr/local/php/extensions/xdebug.so:  dlopen(//usr/local/php/extensions/xdebug.so, 9): no suitable image found.  Did find:
//usr/local/php/extensions/xdebug.so: code signature in =(//usr/local/php/extensions/xdebug.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.
//usr/local/php/extensions/xdebug.so: stat() failed with errno=22











share|improve this question




















  • 1




    See this thread for workarounds: (1) Install apache and php from homebrew (answer by suneet64), (2) Add to /etc/apache2/httpd.conf the line LoadModule php7_module libexec/apache2/libphp7.so at the end, (3) Still in /etc/apache2/httpd.conf uncomment line 545 that says Include /private/etc/apache2/other/*.conf. Let me know if one or more of them solved the problem and I will add a more detailed answer.
    – harrymc
    Oct 1 at 20:22












  • same problem here with dispatcher-apache2.4-4.2.0.so
    – daVe
    Oct 2 at 8:39










  • @harrymc Thanks for the suggestion, but is there any other workaround that does not involve having to install a new instance of apache / php ?
    – delphirules
    Oct 2 at 13:46










  • The above workarounds are independent. Try number (2) and (3) and wait with (1) until you decide to try it.
    – harrymc
    Oct 2 at 14:15










  • @harrymc Should i do 2 AND 3, or only 2 or 3 ?
    – delphirules
    Oct 2 at 15:42













up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





After upgrading to MacOS Mojave, Apache can't load PHP extensions anymore. With any extension I get the error below on the Apache log; it seems that Apple implemented Library Validation through Apache on MacOS Mojave. That makes it apparently impossible to load unsigned binaries with Apache.



Is there any workaround that would not involve to disable MacOS's SIP?




Failed loading //usr/local/php/extensions/xdebug.so:  dlopen(//usr/local/php/extensions/xdebug.so, 9): no suitable image found.  Did find:
//usr/local/php/extensions/xdebug.so: code signature in =(//usr/local/php/extensions/xdebug.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.
//usr/local/php/extensions/xdebug.so: stat() failed with errno=22











share|improve this question















After upgrading to MacOS Mojave, Apache can't load PHP extensions anymore. With any extension I get the error below on the Apache log; it seems that Apple implemented Library Validation through Apache on MacOS Mojave. That makes it apparently impossible to load unsigned binaries with Apache.



Is there any workaround that would not involve to disable MacOS's SIP?




Failed loading //usr/local/php/extensions/xdebug.so:  dlopen(//usr/local/php/extensions/xdebug.so, 9): no suitable image found.  Did find:
//usr/local/php/extensions/xdebug.so: code signature in =(//usr/local/php/extensions/xdebug.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.
//usr/local/php/extensions/xdebug.so: stat() failed with errno=22








macos apache-http-server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 28 at 0:12









CJ Dennis

413516




413516










asked Oct 1 at 18:50









delphirules

2371415




2371415








  • 1




    See this thread for workarounds: (1) Install apache and php from homebrew (answer by suneet64), (2) Add to /etc/apache2/httpd.conf the line LoadModule php7_module libexec/apache2/libphp7.so at the end, (3) Still in /etc/apache2/httpd.conf uncomment line 545 that says Include /private/etc/apache2/other/*.conf. Let me know if one or more of them solved the problem and I will add a more detailed answer.
    – harrymc
    Oct 1 at 20:22












  • same problem here with dispatcher-apache2.4-4.2.0.so
    – daVe
    Oct 2 at 8:39










  • @harrymc Thanks for the suggestion, but is there any other workaround that does not involve having to install a new instance of apache / php ?
    – delphirules
    Oct 2 at 13:46










  • The above workarounds are independent. Try number (2) and (3) and wait with (1) until you decide to try it.
    – harrymc
    Oct 2 at 14:15










  • @harrymc Should i do 2 AND 3, or only 2 or 3 ?
    – delphirules
    Oct 2 at 15:42














  • 1




    See this thread for workarounds: (1) Install apache and php from homebrew (answer by suneet64), (2) Add to /etc/apache2/httpd.conf the line LoadModule php7_module libexec/apache2/libphp7.so at the end, (3) Still in /etc/apache2/httpd.conf uncomment line 545 that says Include /private/etc/apache2/other/*.conf. Let me know if one or more of them solved the problem and I will add a more detailed answer.
    – harrymc
    Oct 1 at 20:22












  • same problem here with dispatcher-apache2.4-4.2.0.so
    – daVe
    Oct 2 at 8:39










  • @harrymc Thanks for the suggestion, but is there any other workaround that does not involve having to install a new instance of apache / php ?
    – delphirules
    Oct 2 at 13:46










  • The above workarounds are independent. Try number (2) and (3) and wait with (1) until you decide to try it.
    – harrymc
    Oct 2 at 14:15










  • @harrymc Should i do 2 AND 3, or only 2 or 3 ?
    – delphirules
    Oct 2 at 15:42








1




1




See this thread for workarounds: (1) Install apache and php from homebrew (answer by suneet64), (2) Add to /etc/apache2/httpd.conf the line LoadModule php7_module libexec/apache2/libphp7.so at the end, (3) Still in /etc/apache2/httpd.conf uncomment line 545 that says Include /private/etc/apache2/other/*.conf. Let me know if one or more of them solved the problem and I will add a more detailed answer.
– harrymc
Oct 1 at 20:22






See this thread for workarounds: (1) Install apache and php from homebrew (answer by suneet64), (2) Add to /etc/apache2/httpd.conf the line LoadModule php7_module libexec/apache2/libphp7.so at the end, (3) Still in /etc/apache2/httpd.conf uncomment line 545 that says Include /private/etc/apache2/other/*.conf. Let me know if one or more of them solved the problem and I will add a more detailed answer.
– harrymc
Oct 1 at 20:22














same problem here with dispatcher-apache2.4-4.2.0.so
– daVe
Oct 2 at 8:39




same problem here with dispatcher-apache2.4-4.2.0.so
– daVe
Oct 2 at 8:39












@harrymc Thanks for the suggestion, but is there any other workaround that does not involve having to install a new instance of apache / php ?
– delphirules
Oct 2 at 13:46




@harrymc Thanks for the suggestion, but is there any other workaround that does not involve having to install a new instance of apache / php ?
– delphirules
Oct 2 at 13:46












The above workarounds are independent. Try number (2) and (3) and wait with (1) until you decide to try it.
– harrymc
Oct 2 at 14:15




The above workarounds are independent. Try number (2) and (3) and wait with (1) until you decide to try it.
– harrymc
Oct 2 at 14:15












@harrymc Should i do 2 AND 3, or only 2 or 3 ?
– delphirules
Oct 2 at 15:42




@harrymc Should i do 2 AND 3, or only 2 or 3 ?
– delphirules
Oct 2 at 15:42










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










The thread Installing on Mojave
lists several independent workarounds:




  1. Uninstall apache and php from your computer and clean up all leftovers

  2. Install apache and php from homebrew (answer by suneet64)


  3. Add at the end of /etc/apache2/httpd.conf the line



    LoadModule php7_module libexec/apache2/libphp7.so



  4. Still in /etc/apache2/httpd.conf uncomment line 545 that says



    Include /private/etc/apache2/other/*.conf







share|improve this answer





















  • For cleaning up see this answer. You might at the last just search the file system for *httpd* to find leftovers, but be very careful to uninstall them correctly.
    – harrymc
    Oct 2 at 18:05












  • Thank you, i could remove one of them. But now i can't find where is the correct Apache's access / error log ; how can i know where are them ? The ones on '/private/var/log/apache2' are not being updated.
    – delphirules
    Oct 2 at 18:17










  • I don't know your setup, so all I can say is that for a clean state you should ensure first that there are no leftovers on the computer. Search for known file names to be sure that you got all of them etc. There is only so much that I can do from far away.
    – harrymc
    Oct 2 at 18:20










  • I found it, i'm almost there. Now when i add the line 'LoadModule php7_module libexec/apache2/libphp7.so', i get this error : httpd: Syntax error on line 535 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found
    – delphirules
    Oct 2 at 18:25










  • "image not found" : you need to find where is libphp7.so. But did you test without it?
    – harrymc
    Oct 2 at 19:12











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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',
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%2fsuperuser.com%2fquestions%2f1363013%2fapache-cant-load-php-unsigned-extensions-on-mac-os-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








up vote
2
down vote



accepted










The thread Installing on Mojave
lists several independent workarounds:




  1. Uninstall apache and php from your computer and clean up all leftovers

  2. Install apache and php from homebrew (answer by suneet64)


  3. Add at the end of /etc/apache2/httpd.conf the line



    LoadModule php7_module libexec/apache2/libphp7.so



  4. Still in /etc/apache2/httpd.conf uncomment line 545 that says



    Include /private/etc/apache2/other/*.conf







share|improve this answer





















  • For cleaning up see this answer. You might at the last just search the file system for *httpd* to find leftovers, but be very careful to uninstall them correctly.
    – harrymc
    Oct 2 at 18:05












  • Thank you, i could remove one of them. But now i can't find where is the correct Apache's access / error log ; how can i know where are them ? The ones on '/private/var/log/apache2' are not being updated.
    – delphirules
    Oct 2 at 18:17










  • I don't know your setup, so all I can say is that for a clean state you should ensure first that there are no leftovers on the computer. Search for known file names to be sure that you got all of them etc. There is only so much that I can do from far away.
    – harrymc
    Oct 2 at 18:20










  • I found it, i'm almost there. Now when i add the line 'LoadModule php7_module libexec/apache2/libphp7.so', i get this error : httpd: Syntax error on line 535 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found
    – delphirules
    Oct 2 at 18:25










  • "image not found" : you need to find where is libphp7.so. But did you test without it?
    – harrymc
    Oct 2 at 19:12















up vote
2
down vote



accepted










The thread Installing on Mojave
lists several independent workarounds:




  1. Uninstall apache and php from your computer and clean up all leftovers

  2. Install apache and php from homebrew (answer by suneet64)


  3. Add at the end of /etc/apache2/httpd.conf the line



    LoadModule php7_module libexec/apache2/libphp7.so



  4. Still in /etc/apache2/httpd.conf uncomment line 545 that says



    Include /private/etc/apache2/other/*.conf







share|improve this answer





















  • For cleaning up see this answer. You might at the last just search the file system for *httpd* to find leftovers, but be very careful to uninstall them correctly.
    – harrymc
    Oct 2 at 18:05












  • Thank you, i could remove one of them. But now i can't find where is the correct Apache's access / error log ; how can i know where are them ? The ones on '/private/var/log/apache2' are not being updated.
    – delphirules
    Oct 2 at 18:17










  • I don't know your setup, so all I can say is that for a clean state you should ensure first that there are no leftovers on the computer. Search for known file names to be sure that you got all of them etc. There is only so much that I can do from far away.
    – harrymc
    Oct 2 at 18:20










  • I found it, i'm almost there. Now when i add the line 'LoadModule php7_module libexec/apache2/libphp7.so', i get this error : httpd: Syntax error on line 535 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found
    – delphirules
    Oct 2 at 18:25










  • "image not found" : you need to find where is libphp7.so. But did you test without it?
    – harrymc
    Oct 2 at 19:12













up vote
2
down vote



accepted







up vote
2
down vote



accepted






The thread Installing on Mojave
lists several independent workarounds:




  1. Uninstall apache and php from your computer and clean up all leftovers

  2. Install apache and php from homebrew (answer by suneet64)


  3. Add at the end of /etc/apache2/httpd.conf the line



    LoadModule php7_module libexec/apache2/libphp7.so



  4. Still in /etc/apache2/httpd.conf uncomment line 545 that says



    Include /private/etc/apache2/other/*.conf







share|improve this answer












The thread Installing on Mojave
lists several independent workarounds:




  1. Uninstall apache and php from your computer and clean up all leftovers

  2. Install apache and php from homebrew (answer by suneet64)


  3. Add at the end of /etc/apache2/httpd.conf the line



    LoadModule php7_module libexec/apache2/libphp7.so



  4. Still in /etc/apache2/httpd.conf uncomment line 545 that says



    Include /private/etc/apache2/other/*.conf








share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 2 at 18:02









harrymc

250k10258554




250k10258554












  • For cleaning up see this answer. You might at the last just search the file system for *httpd* to find leftovers, but be very careful to uninstall them correctly.
    – harrymc
    Oct 2 at 18:05












  • Thank you, i could remove one of them. But now i can't find where is the correct Apache's access / error log ; how can i know where are them ? The ones on '/private/var/log/apache2' are not being updated.
    – delphirules
    Oct 2 at 18:17










  • I don't know your setup, so all I can say is that for a clean state you should ensure first that there are no leftovers on the computer. Search for known file names to be sure that you got all of them etc. There is only so much that I can do from far away.
    – harrymc
    Oct 2 at 18:20










  • I found it, i'm almost there. Now when i add the line 'LoadModule php7_module libexec/apache2/libphp7.so', i get this error : httpd: Syntax error on line 535 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found
    – delphirules
    Oct 2 at 18:25










  • "image not found" : you need to find where is libphp7.so. But did you test without it?
    – harrymc
    Oct 2 at 19:12


















  • For cleaning up see this answer. You might at the last just search the file system for *httpd* to find leftovers, but be very careful to uninstall them correctly.
    – harrymc
    Oct 2 at 18:05












  • Thank you, i could remove one of them. But now i can't find where is the correct Apache's access / error log ; how can i know where are them ? The ones on '/private/var/log/apache2' are not being updated.
    – delphirules
    Oct 2 at 18:17










  • I don't know your setup, so all I can say is that for a clean state you should ensure first that there are no leftovers on the computer. Search for known file names to be sure that you got all of them etc. There is only so much that I can do from far away.
    – harrymc
    Oct 2 at 18:20










  • I found it, i'm almost there. Now when i add the line 'LoadModule php7_module libexec/apache2/libphp7.so', i get this error : httpd: Syntax error on line 535 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found
    – delphirules
    Oct 2 at 18:25










  • "image not found" : you need to find where is libphp7.so. But did you test without it?
    – harrymc
    Oct 2 at 19:12
















For cleaning up see this answer. You might at the last just search the file system for *httpd* to find leftovers, but be very careful to uninstall them correctly.
– harrymc
Oct 2 at 18:05






For cleaning up see this answer. You might at the last just search the file system for *httpd* to find leftovers, but be very careful to uninstall them correctly.
– harrymc
Oct 2 at 18:05














Thank you, i could remove one of them. But now i can't find where is the correct Apache's access / error log ; how can i know where are them ? The ones on '/private/var/log/apache2' are not being updated.
– delphirules
Oct 2 at 18:17




Thank you, i could remove one of them. But now i can't find where is the correct Apache's access / error log ; how can i know where are them ? The ones on '/private/var/log/apache2' are not being updated.
– delphirules
Oct 2 at 18:17












I don't know your setup, so all I can say is that for a clean state you should ensure first that there are no leftovers on the computer. Search for known file names to be sure that you got all of them etc. There is only so much that I can do from far away.
– harrymc
Oct 2 at 18:20




I don't know your setup, so all I can say is that for a clean state you should ensure first that there are no leftovers on the computer. Search for known file names to be sure that you got all of them etc. There is only so much that I can do from far away.
– harrymc
Oct 2 at 18:20












I found it, i'm almost there. Now when i add the line 'LoadModule php7_module libexec/apache2/libphp7.so', i get this error : httpd: Syntax error on line 535 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found
– delphirules
Oct 2 at 18:25




I found it, i'm almost there. Now when i add the line 'LoadModule php7_module libexec/apache2/libphp7.so', i get this error : httpd: Syntax error on line 535 of /usr/local/etc/httpd/httpd.conf: Cannot load libexec/apache2/libphp7.so into server: dlopen(/usr/local/opt/httpd/libexec/apache2/libphp7.so, 10): image not found
– delphirules
Oct 2 at 18:25












"image not found" : you need to find where is libphp7.so. But did you test without it?
– harrymc
Oct 2 at 19:12




"image not found" : you need to find where is libphp7.so. But did you test without it?
– harrymc
Oct 2 at 19:12


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • 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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2fsuperuser.com%2fquestions%2f1363013%2fapache-cant-load-php-unsigned-extensions-on-mac-os-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

If I really need a card on my start hand, how many mulligans make sense? [duplicate]

Alcedinidae

Can an atomic nucleus contain both particles and antiparticles? [duplicate]