Issue
When attempting to run selected drush php
commands on Drupal 7 site the command errors.
Example
/var/www/html/[sitename.env]/docroot$ drush php
Symfony\Component\Console\Exception\InvalidArgumentException: Command name "" is invalid. in [error]
...
Resolution
Use the drush7 executable to run the commands successfully against your Drupal 7 site, this is because drush8
is the default drush
used.
Example
/var/www/html/[sitename.env]/docroot$ drush7 php
[1] [sitename.env]> exit;