Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Your environment or operation system isn't supported' in phar:///usr/bin/drush/vendor/webmozart/path-util/src/Path.php:257 #2405

Closed
MradulaPai opened this issue Oct 19, 2016 · 10 comments

Comments

@MradulaPai
Copy link

I am trying automate the Dkan installation on Elastic Beanstack.
After every required installation,
If i run drush si dkan --verbose --account-pass='admin' --site-name='EIC' install_configure_form.update_status_module="'array(FALSE,FALSE)'" --yes
is working throwing below error.
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Your environment or operation system isn't supported' in phar:///usr/bin/drush/vendor/webmozart/path-util/src/Path.php:257

But manually above command working fine. Need some help here.

@weitzman
Copy link
Member

weitzman commented Oct 19, 2016

Whats your OS and version of that OS?

/**
     * Returns canonical path of the user's home directory.
     *
     * Supported operating systems:
     *
     *  - UNIX
     *  - Windows8 and upper
     *
     * If your operation system or environment isn't supported, an exception is thrown.
     *
     * The result is a canonical path.
     *
     * @return string The canonical home directory
     *
     * @throws RuntimeException If your operation system or environment isn't supported
     *
     * @since 2.1 Added method.
     */
    public static function getHomeDirectory()
    {
        // For UNIX support
        if (getenv('HOME')) {
            return static::canonicalize(getenv('HOME'));
        }

        // For >= Windows8 support
        if (getenv('HOMEDRIVE') && getenv('HOMEPATH')) {
            return static::canonicalize(getenv('HOMEDRIVE').getenv('HOMEPATH'));
        }

        throw new RuntimeException("Your environment or operation system isn't supported");
    }

@MradulaPai
Copy link
Author

Hi i am using AWS elastic bean stack with php 5.6.25 64 bit amazon linux v2.1.7

@MradulaPai
Copy link
Author

can you please explain

@weitzman
Copy link
Member

The next version of Drush will no longer error like you are seeing.

@MradulaPai
Copy link
Author

MradulaPai commented Oct 19, 2016

Thank you for that.

@MradulaPai
Copy link
Author

Hi, I have did the Dkan-Drupal setup once again, still getting the same error.

@MradulaPai
Copy link
Author

We are taking Drush from
php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush.phar');" > /usr/bin/drush

@terao
Copy link

terao commented Oct 21, 2016

hi @weitzman !
thank you for fix it!
When the next version is released?
We are very troubled by not move the automatic installation.

gaelg pushed a commit to gaelg/drush that referenced this issue Nov 7, 2016
@kamalkech
Copy link

@MradulaPai :

PHP Warning: readfile(https://s3.amazonaws.com/files.drush.org/drush.phar): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error
in Command line code on line 1

mikeker pushed a commit to mikeker/drush that referenced this issue Aug 10, 2017
@thirdender
Copy link

Elastic Beanstalk hooks are run as nobody, so you need to export a value for HOME before running drush.

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/91_drupal_uuid.sh":
    mode: "000755"
    owner: root
    group: root
    content: |
      #!/bin/sh

      # Set $HOME to prevent https://github.com/hechoendrupal/drupal-console-core/issues/255
      export HOME=/var/www/html

      # Get configured Drupal environment variables from Elastic Beanstalk
      # before running Drush
      keys=( RDS_HOSTNAME RDS_PORT RDS_DB_NAME RDS_USERNAME RDS_PASSWORD DRUPAL_HASH_SALT DRUPAL_SYNC_DIR )
      for key in "${keys[@]}"
      do
        export $key=`/opt/elasticbeanstalk/bin/get-config environment -k $key`
      done

      # Set site UUID
      /var/www/html/vendor/bin/drush --root=/var/www/html -y config-set "system.site" uuid "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants