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.