Skip to main content

Bash force php-cli

Comments

5 comments

  • grayloon
    It may be worth noting that my bash scripts runs just fine when I execute it directly in a terminal.
    0
  • cPanelMichael
    Hello @grayloon, You can use the /usr/local/bin/php path in the bash script so the cron job uses the php-cli binary. We document how this works at the link below:
    0
  • grayloon
    In my script, I'm using: /usr/local/bin/php /home/cdavis/.platformsh/bin/platform
    Unfortunately, the child process is still using php-cgi for some reason: [QUOTE]cdavis 26991 92.1 0.4 521268 18652 ? R 07:57 1:57 /opt/cpanel/ea-php72/root/usr/bin/php-cgi /usr/local/bin/drush version --format=string
    0
  • cPanelMichael
    Hello @grayloon, Does it make a difference if you update the command to use /usr/local/bin/ea-php72 as the PHP binary path? Thank you.
    0
  • grayloon
    I was finally able to get it working. I used both the direct path to the PHP binary as well as the drush binary.
    0

Please sign in to leave a comment.