Drupal 8 comes with the feature that a language can be selected and automatically downloaded on installation without any manual actions required.

Unfortunately this does not seem to work on simplytest.me

Following requirement error message is shown after selecting any other language than english:

The translations directory is not executable.
The installer requires execute permissions to sites/default/files/translations during the installation process. If you are unsure how to grant file permissions, consult the online handbook.

The sites/default/files/translations directory exists and is and acually also executable:

$ www/sites/default/files # ls -la
total 16
drwxrwxrwx 4 user nogroup 4096 Jan 11 14:51 .
dr-xr-xr-x 3 user nogroup 4096 Jan 11 14:51 ..
drwxrwxrwx 2 user nogroup 4096 Jan 11 14:51 translations
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sutharsan’s picture

Running on windows? Have a look at https://drupal.org/node/1885510.

patrickd’s picture

definitely NOT ;-)

(see command line output in summary)

YesCT’s picture

Issue tags: +D8MI
patrickd’s picture

The server:

ubuntu 12.04
apache2 with fcgi, suExec
php5 with safe_mode=On

Configuration is a bit "exotic", but most secure for the needs of simplytest.me

YesCT’s picture

  // Get values so the requirements errors can be specific.
  if (drupal_verify_install_file($translations_directory, FILE_EXIST|FILE_WRITABLE, 'dir')) {
    $readable = is_readable($translations_directory);
    $writable = is_writable($translations_directory);
    $executable = is_executable($translations_directory);
    $translations_directory_exists = TRUE;
  }

the tests for executable are done only if drupal_verify_install_file returns true.
perhaps your directory exists (and is executable) even though that did not return true?

patrickd’s picture

drupal_verify_install_file($translations_directory, FILE_EXIST|FILE_WRITABLE, 'dir') => TRUE
is_readable($translations_directory); => TRUE
is_writable($translations_directory); => TRUE
is_executable($translations_directory); => FALSE

File permissions are still "drwxrwxrwx"

YesCT’s picture

Status: Active » Needs review
FileSize
894 bytes

if you want, also try the patch in #1885510-5: Can't install on some systems (like windows) due to folder permissions (executable check not needed) that removes all the executable checks.

For this more specific problem, here is a patch that gets the values for the requirements errors if the directory exists.
Also changed the order to move the TRUE it exists to the first part of the if, which makes more sense with the new if condition.

  // Get values so the requirements errors can be specific.
  if (is_dir($translations_directory)) {
    $translations_directory_exists = TRUE;
    $readable = is_readable($translations_directory);
    $writable = is_writable($translations_directory);
    $executable = is_executable($translations_directory);
  }
YesCT’s picture

Status: Needs review » Needs work

hmm. re #6

http://php.net/manual/en/function.is-executable.php

says:

In php5, as opposed to php4, you can no longer rely on is_executable to check the executable bit on a directory in 'nix. You can still use the first note's method to check if a directory is traversable:
@file_exists("adirectory/.");

Hmm. well. the check works on my 'nix (Mac) but seems will not work on all. So..

patrickd’s picture

Patch of #7 does not help.
Patch of #1885510: Can't install on some systems (like windows) due to folder permissions (executable check not needed) works.

So it must be an issue with is_executable()

YesCT’s picture

Title: Unable to install Drupal 8 with different language » Install in different language requirement warns translations dir not executable, when the dir is executable on some systems
Project: simplytest.me » Drupal core
Version: » 8.x-dev
Component: Code » install system
Priority: Major » Normal
Status: Needs work » Needs review

Trying that.
I'm guessing this is not exclusive to simplytest.me. So moving to core.

YesCT’s picture

YesCT’s picture

Just a note in case this helps someone, when retesting installs...

sudo rm -r sites
git checkout sites
drush -y sql-drop --db-url="mysql://root:root@localhost/d8-git"

To fake what might happen on my system having a translations file that is not executable I:
We dont want people to do this... we want them to test on their system :)
mkdir sites/default/files
mkdir sites/default/files/translations
chmod a-x sites/default/files/translations

YesCT’s picture

eigentor’s picture

Ah! Applying this patch helped to install on Windows 7 for me. I had already made files and files/translations made world executable, so if you need a test if it works even without that, I can try again.
So great to install Drupal localized right from the start... awesomeness.

YesCT’s picture

@eigentor yes, please
Actually...
1) try installing again with files and translations executable, but without this patch.
then
2) try installing again with this patch, but without making files and files/translations executable.

Thanks so much!

Sutharsan’s picture

Status: Needs review » Needs work
+++ b/core/includes/install.core.incundefined
@@ -1854,11 +1854,13 @@ function install_check_translations($install_state) {
-    $executable = is_executable($translations_directory);
-    $translations_directory_exists = TRUE;
+    // See http://php.net/manual/en/function.is-executable.php
+    // is_executable() does not work reliably for directories on some systems.
+    $executable = @file_exists($translations_directory . '/.');

I can't remember why I added the is_executable() for the directory. The code which creates/checks the settings.php file does not use it either. That is my first argument for not using. And secondly, I expect @file_exists() to return FALSE if it fails to check (as some people are experiencing now). The '@' only suppresses the error. Read more about the '@' here: http://php.net/manual/en/language.operators.errorcontrol.php

YesCT’s picture

I think the @ allows us to give our own error in the requirements.
We could take out the check for the directory being executable, if that condition is super rare (to have the directory exist, be readable and not executable, and if the system never checks if files is executable, that might be a hint that someone has already been through this, and decided checking for executable does not make sense. See the second half of (second image in) #1885510-7: Can't install on some systems (like windows) due to folder permissions (executable check not needed). That issue removes all checks of executable, and the concern I had there was that the error message then just said to try another language (which would not help).

Sutharsan’s picture

But @file_exists($translations_directory . '/.') == FALSE means it is not executable OR php failed to test. we need add an custom error handler to catch the error. But is it really worth it?
The read bit allows the affected user to list the files within the directory, The execute bit allows the affected user to enter it and access files and directories inside (source: unix.stackexhange.com). Not all file systems support the execution permission on directories, among which a number of windows OS (source: wikipedia.org).

Gábor Hojtsy’s picture

So looks like best would be to remove he executability check :) Is this a duplicate of #1885510: Can't install on some systems (like windows) due to folder permissions (executable check not needed)?

YesCT’s picture

Status: Needs work » Closed (duplicate)

I'm ok with that. Lets decide to go with that solution since my concern about the situation where a directory actually not being executable and that causing a problem might be super rare.