Skip to content

Instantly share code, notes, and snippets.

@twfahey1
Last active August 4, 2022 11:04
Show Gist options
  • Save twfahey1/235f3f0feaafea4c4bb7a03a3f4c9a50 to your computer and use it in GitHub Desktop.
Save twfahey1/235f3f0feaafea4c4bb7a03a3f4c9a50 to your computer and use it in GitHub Desktop.
Pantheon - run php-script (php eval alternative) via terminus against a site
cat hello.php | terminus remote:wp ${SITE}.${ENV} -- eval-file -
cat << 'EOF' | terminus drush site.env -- php-script -
echo PHP_VERSION;
EOF
@Ahmed-Sz
Copy link

Ahmed-Sz commented Aug 4, 2021

Thank you so much for this Taylor! This was very helpful.

@carl-drews
Copy link

carl-drews commented Oct 4, 2021

When will this command be supported in terminus 3? I see no error but also no output:

`acom-webmaster:/home/drews/2021/Drupal/acom-unity> cat example03.sh

cat << 'EOF' | t3 drush acom-unity.dev -- php-script -
print 456*789;
print "\n";
EOF
acom-webmaster:/home/drews/2021/Drupal/acom-unity> ./example03.sh
[warning] This environment is in read-only Git mode. If you want to make changes to the codebase of this site (e.g. updating modules or plugins), you will need to toggle into read/write SFTP mode first.
[notice] Command: acom-unity.dev -- drush php-script [Exit: 0]
acom-webmaster:/home/drews/2021/Drupal/acom-unity> t3 -V
Terminus 3.0.0-alpha
acom-webmaster:/home/drews/2021/Drupal/acom-unity>`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment