0

I've got a server that is running Linux Debian and have apache2 and php5 installed but I have no control over its apache configuration. If I create a .htaccess file on the server to do for instance a basic authentication on a directory it works. However if I want to use any extension to be executable as PHP such as file.abc with AddType it makes it downloadable. Although PHP extensions such as php1, php2, php3, php4, php5 and phtml are perfectly executable as PHP on this server.

My Question is If Basic Auth is working but any.ext cannot be executable as PHP does that mean AllowOverride is set to None? Then how basic Auth is working? And am I able to make any.ext executable as PHP on this server?

  • one way to know if AllowOverride is set to None is if it does not read the .htaccess file when you access your site a simple test is to put an errorneous string in an .htaccess and try to access that site if it show error then AllowOverride is not set to None. – Christopher Pelayo Apr 27 '18 at 08:43
  • I've tested it locally and it worked. Thank you so much for clarifying this out to me. However it doesn't make any sense that this server can read .htaccess but it won't allow me to execute any other extension .abc as PHP instead making it downloadable. Although I managed to make Perl script executable with AddType. I'm confused! – PrivateIntID Apr 27 '18 at 10:08
  • please show us exactly the line with AddType – Andra Apr 27 '18 at 10:58
  • AddType application/x-httpd-php .abc – PrivateIntID Apr 27 '18 at 13:18
  • did you try `AddType application/x-httpd-php5 .abc`, that is, with 5 at the end? See [https://stackoverflow.com/questions/4687208/using-htaccess-to-make-all-html-pages-to-run-as-php-files](https://stackoverflow.com/questions/4687208/using-htaccess-to-make-all-html-pages-to-run-as-php-files) – Andra Apr 27 '18 at 15:18
  • Ive followed the link and took my time to read and also test all suggested answers but none worked for me. However, when I've tested them on my local machine, most of them have worked. I just can't get this server parsing php code with different extension. Thank you so much guys for all the help provided. – PrivateIntID Apr 28 '18 at 13:05

0 Answers0