I am using the default installations of Apache2 and php7 that came with Catalina on a Mac AIR.

I am trying to run the classic phpinfo.php script:

<?php phpinfo.php ?>

My https.conf file contains:

AddHandler cgi-script .cgi .pl .py .php

I was getting AH01215 (8)Exec format error messages in the Apache2 error_log file. On another Stack, I saw the suggestion that I needed

AddHandler application/x-httpd-php .php

in my httpd.conf file. I added it. I no longer get AH01215 error messages; in fact I get no error messages at all, However, now all that happens when I run the script is that a Save dialogue box pops up and offers to save the script in my Documents folder. If I click OK, it does just that. I have been searching the Internet for an hour and I cannot find any example of this, or any idea off how to correct it. A second Stack page suggested this as a fix for another problem:

AddType application/x-httpd-php .php

I added that, too, with no effect. (I was careful to run apachectl -k restart, and to chmod 755 everything.) The thing that worries and surprises me is the absence of error messages in the error_log file.

I have run php scripts on Windows and FreeBSD computers without a shebang line -- I never thought they were used with php -- but I have seen other posters on other websites recommend the. (What I haven't seen is a response like "that fixed my problem".) The access_log file shows normal "GET" and "POST" 200 codes.

Python and Perl scripts run fine.

Any help appreciated.

You must log in to answer this question.

Browse other questions tagged .