I run the drush command for security review command `drush secrev`
Show me this error after running finished
[error] Message: Error executable_php, access was denied to the file.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

MahmoudSayed96 created an issue. See original summary.

rajdip_755’s picture

StatusFileSize
new38.81 KB

Hi @MahmoudSayed96, I can replicate the same issue in my local setup.
You can take create a sibling folder of webroot named drush in you project directory and create a drush.yml file inside that with the following details.

options:
  uri: '<your_site_url>'

Ref: https://drupal.stackexchange.com/questions/197651/how-i-change-my-site-u...
In this way, you can set the drush uri, which can resolved the issue. Please check this way and let me know if it's worked for you.
I'm attaching the screenshot here after following the above mentioned steps.

bgustafson’s picture

I am seeing the same Error executable_php, access was denied to the file. error message, both when I run security review in the browser or via drush (and I do have a drush file with the site URI specified); the difference is that I actually see the security review results in the browser (in addition to the error message), whereas via drush there is no review output.

rajdip_755’s picture

StatusFileSize
new165.77 KB
new20.45 KB
new51.59 KB

Hi @bgustafson, Previously I have uploaded the screenshot of the terminal after running drush secrev now I'm attaching here the screenshot of the page after running the security review from the following url /admin/reports/security-review. Still I'm not getting any executable_php error.

I think there maybe some permission related issue. For the clarification I'm attaching here the file permissions of the particular file and /sites/default/files folder.

Thanks !

smustgrave’s picture

Status: Active » Postponed (maintainer needs more info)

@bgustafson if you can check what was posted in #4

menuchin’s picture

I have the same effect as colleague @bgustafson in the browser. I don't use drush to confirm the second symptom. Access rights are ok.

prudloff’s picture

This rule in Drupal's .htaccess file denies access to PHP files:

  # For security reasons, deny access to other PHP files on public sites.
  # Note: The following URI conditions are not anchored at the start (^),
  # because Drupal may be located in a subdirectory. To further improve
  # security, you can replace '!/' with '!^/'.
  # Allow access to PHP files in /core (like authorize.php or install.php):
  RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$
  # Allow access to test-specific PHP files:
  RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?\.php
  # Allow access to Statistics module's custom front controller.
  # Copy and adapt this rule to directly execute PHP files in contributed or
  # custom modules or to run another PHP application in the same directory.
  RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics\.php$
  # Deny access to any other PHP files that do not match the rules above.
  # Specifically, disallow autoload.php from being served directly.
  RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]

So the check not being able to fetch the PHP file should not be an error, it should mean Drupal is correctly protected and make the check succeed.

prudloff’s picture

Status: Postponed (maintainer needs more info) » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Comment in MR

prudloff’s picture

Status: Needs work » Needs review

  • smustgrave committed 542cb14e on 3.0.x
    Issue #3452617 by prudloff, rajdip_755: [error]  Message: Error...
smustgrave’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.