0

Normally you need to do a chmod 755 for a Perl script, Python script or whatever if you like to run it as a CGI in Apache. But why isn't that necessary for PHP scripts?

Tom Zych
  • 13,329
  • 9
  • 36
  • 53

2 Answers2

2

You don't need to grant execution rights, because the file is read by apache with php, not executed directly.

Manatax
  • 4,083
  • 5
  • 30
  • 40
0

The webserver configuration file tells it that when a file has a .php extension, it should be processed with PHP.

Barmar
  • 741,623
  • 53
  • 500
  • 612
  • OK. And where is it defined? And can I define another language like Perl? – user3785044 Jun 28 '14 at 01:39
  • On my server it's in `/etc/httpd/conf.d/php.conf`. It loads a module `php4_module` that implements it. I don't know if there's something similar for Perl. – Barmar Jun 28 '14 at 03:13
  • Maybe `mod_perl` offers similar capabilities, I don't know. If you want to ask questions about server configuration, ServerFault or Webmasters would probably be better places. – Barmar Jun 28 '14 at 03:15