-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for custom PHP binary #3
Comments
This is a tricky one and I am not sure if we ever are going to be able to successfully do this in an automated fashion. Currently it uses Based on a suggestion by Anton we probably should do some minimal comparison. Ie if /usr/bin/env php is 5.6 on M2.3 install we should fail. |
I think we should definitely start by adding an extra optional parameter Anyone knows how to best detect the current needed / running version of php? It doesn't look like composer.lock holds this information. And just running php -v may be incorrect (in my current example one has to know it is is /usr/local/php70/bin/php-cli and php -v would be 7.4). Best I can come up with so far is create a temporary phpinfo file, open the web/secure/base_url via curl or something to then read out the php version. Less than ideal. |
I'm a little bit lost on the context and lack the time to dive into this, but here is some cents: If I create a sample script #!/usr/bin/env php
<?php echo phpversion()."\n"; I can Now I've got another binary |
@jissereitsma Thanks for chiming in. I am currently grappling with the inverse (in other words I am not the one who is setting up the server). Ideally we would be able to run some command and that will spit out |
We can now override the php binary via command line input Next steps I think could be to run a version comparison of the php binary and what is in vendor/magento/magento2-base/composer.json as a check. One idea to investigate would be to parse the history of the shell and then grab whatever is in front of the last bin/magento command as presumably someone was using it prior. |
The current approach is using the
php
binary as the one to be used for runningbin/magento
amongst other things. In some situations, thephp
default binary might be pointing to say PHP 5.6, while the/usr/bin/php7.2
should be used instead. Perhaps, there could be a check for an environment variablePHP=/usr/bin/php7.2
to bypass this issue.The text was updated successfully, but these errors were encountered: