Adding this code:
AddType application/x-httpd-php .php
after
...
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
to
C:\Apache24\bin\httpd.conf
downloads all PHP pages on my system rather than render it.
Before then, the PHP pages were parsed as raw text.
Help needed!
There are two problems:
application/x-httpd-php
is not a MIME type, but rather a handler. That means your directive must be AddHandler
instead of AddType
application/x-httpd-php
is not a valid handler. The handler must include the PHP version digits at the end of the string
Putting that altogether, assuming, say PHP version 7.2, what you want is
✅ AddHandler application/x-httpd-php72 .php
instead of
🚫 AddType application/x-httpd-php .php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With