Skip to main content

How to get `drush` to use the correct URL?


1 comment

  • DevRel

    Check **drush** uses the correct URL, you can follow the steps provided in the solution you mentioned

    Check the **platformsh_generate_drush_yml.php** script: Ensure that the script **platformsh_generate_drush_yml.php** is present in your project. If you based your build on the Drupal 8 or 9 template, it should already be there. If you imported your project yourself, make sure the file is present in your project’s root directory

    Check that the deploy hook in your .**** file invokes the **platformsh_generate_drush_yml.php** script. It should look like this

      deploy: |
        php ./drush/platformsh_generate_drush_yml.php

    Deploy your application with the changes to the **platformsh_generate_drush_yml.php** script and the deploy hook.

    platform deploy
    Once deployment is successful, SSH into your environment and check the content of the generated Drush configuration file .drush/drush.yml to make sure it includes the correct site URL.

    platform ssh “cat /app/.drush/drush.yml”
    Verify drush status…
    Finally, run drush status to ensure that drush is using the correct URL
    I hope the output should display the correct site URI.


Please sign in to leave a comment.