4

I just downloaded the latest version of Craft (2.3.2617) and extracted the zip to check it out. Every file has execute permissions turned on for all users. Is there any reason for this?

1

Folders need to be executable for Apache/PHP to be able to open them and read their contents.

I'm guessing it's more of a a case of our build script being overly aggressive and setting the execute bit on files.

From what I can tell, though, setting the execute bit on a PHP script is effectively pointless.

1
  • I believe setting as executable applies to more of a command line functionality. To execute a PHP script in terminal, you set it as executable before you can run the script. – Jason McCallister Dec 6 '14 at 18:28
1

(I'm fairly new to the Craft CMS Stack Exchange - so I lack the minimum 50 reputation to reply to the comment by @jason-mccallister; apologies in advance for the etiquette faux-pas)

If you're using a Shebang at the top your PHP file (#!/usr/bin/php or similar), then your script will need the relevant execute bit set (for the user, the file's group, or world).

However - if you're calling your PHP script by passing it as an argument to your PHP binary as follows:

/usr/bin/php foo.php

then you do not need an execute bit set (or the Sheband at the top of the PHP file, for that matter) - only an appropriate read bit.

1
  • So it sounds like it'd be pretty harmless for us to stop setting them to be executable. – Brad Bell Dec 17 '14 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.