Bash force php-cli
We use a 3rd-party host (Platform.sh) for some of our sites. They provide their own CLI utility as a phar file. On my cPanel server, I'm using cron to call a bash script that's executing the platform.sh commands. When the initial command is executed, it kicks off a php process. Unfortunately, there are some child processes that run as php-cgi, and the platform.sh utility hangs. Is there a way to force a command to execute as php-cli vs. php-cgi? I'd like to keep using PHP-FPM on my cPanel server.
-
It may be worth noting that my bash scripts runs just fine when I execute it directly in a terminal. 0 -
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=string0 -
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 -
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.
Comments
5 comments