PHP files, PDF files and others will all be executed or downloaded. If you want to show a file in plain text instead, such as a PHP file, you should instruct Apache to do so.
In your .htaccess file, you should instruct your webserver to serve files with a certain extension as plain text to the user. In the example below, we want Apache to show all PHP files instead of being executed by the PHP engine.
AddType text/plain php
Additionally, you can add multiple filetypes. Simply add the extension name at the end:
AddType text/plain php html sh xml