0

I have installed php with brew install php and added

LoadModule php_module /usr/local/opt/php/lib/httpd/modules/libphp.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

/etc/apache2/httpd.conf as the installation process instructs to enable php in apache. And when I check for apache configuration with apachectl configtest. I am getting error as

[so:error] [pid 1735] AH06665: No code signing authority for module at /usr/local/opt/php/lib/httpd/modules/libphp.so specified in LoadModule directive.
httpd: Syntax error on line 191 of /private/etc/apache2/httpd.conf: Code signing absent - not loading module at: /usr/local/opt/php/lib/httpd/modules/libphp.so

How can I solve this issue to enable php module in apache? Because when I try to access localhost/index.php, my index.php is located in Library/Webserver/Documents/index.php it outputs the raw PHP code instead of executed result. So how can I enable php in apache? My OS is MacOs 13 ventura.

  • have you checked the path to the `libphp.so` ? could be `/opt/homebrew` etc.. have you restarted the apache server to load new configuration ? – Kazz May 27 '23 at 16:06
  • yes I have checked the path to libphp.so and also restarted the apache server – user15539888 May 27 '23 at 16:09
  • certificate issue ? https://www.codexpedia.com/apache-server/no-code-signing-authority-for-module-php-on-mac-monterey/ – Kazz May 27 '23 at 16:14
  • Yes I have created a certificate and signed it. Now I have phpmyadmin inside /Library/Webserver/Documents/phpmyadmin When I try to access localhost/phpmyadmin, it says This page isn’t workinglocalhost didn’t send any data. ERR_EMPTY_RESPONSE – user15539888 May 27 '23 at 16:30
  • does the apache server run `apachectl status` ? – Kazz May 27 '23 at 16:38
  • Go to http://localhost:80/server-status in the web browser of your choice. Note that mod_status must be enabled for this to work. This is what i got when i run apachectl status – user15539888 May 27 '23 at 16:41
  • don't know your system, something bad happen with apache server when you do not have response, check if it run per your system configuration, something like `launchctl print system/org.apache.httpd`, `brew services info httpd`, `apachectl -e error` – Kazz May 27 '23 at 16:50
  • I can access localhost/phpmyadmin in safari browser but not in chrome browser, also when I access localhost/index.php in safari browser it prints raw code instead of execution result but same works in chrome – user15539888 May 27 '23 at 16:53
  • (48)Address already in use: AH00072: make_sock: could not bind to address [::]:80 (48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs – user15539888 May 27 '23 at 16:55
  • some process already use the port, most likely httpd, dunno how this could happen, how do you start/restart the service ? maybe explicit stop and start would solve it `apachectl stop` and then `apachectl start`, or maybe reinstall the apache as this should not happen normally like `brew reinstall httpd` - should keep the configs intact. or restart whole system, i know bad advice but could be most simple :D – Kazz May 27 '23 at 17:03
  • Thanks @Kazz. I will try it. When i run sudo lsof -i :80, it shows empty results.How could the port is already loaded ? I don't understand that. Anyway thanks Kazz for your support. – user15539888 May 27 '23 at 17:11
  • https://stackoverflow.com/questions/64912014/mac-os-big-sur-homebrew-apache-48address-already-in-use-ah00072-make-sock could help – Kazz May 27 '23 at 17:42
  • Open a web browser to port 80 (http://localhost). That might help you figure out what is running on port 80. – John Hanley May 27 '23 at 20:39

0 Answers0