A domain’s web selection does not guarantee that a bare php command uses the same runtime. Composer and cron can load different extensions and configuration files.
Compare the environments
- Note the web version and required modules in the application’s protected diagnostics.
- In Terminal, run php -v and php --ini. Review private paths before sharing output.
- Run php -m to inspect CLI extensions. Missing database drivers or mbstring can explain failure while the website works.
- Ask the host for the absolute CLI path matching the intended runtime. Do not copy a binary path from another provider.
- Configure cron with that binary and the application’s full path. Test a harmless diagnostic before scheduling a task that changes data.
Keep responsibilities separate
MultiPHP and Selector affect web execution through the host’s integration. They do not rewrite every shell command. An INI file in an unrelated folder may never be loaded by cron.
Record the working command and keep logs outside the public document root. Do not embed passwords or API keys in cron commands. Capture the exit code and a redacted error before changing versions. Matching the major/minor version alone is insufficient when the extension sets differ.
Official references
Reviewed 2026-10-22. Menus and availability depend on your hosting plan and server configuration.
