3

I’m trying to install Magento 2.3 with Composer, with php 72. I am hosted on a shared cloud server that has php 70 as the server version (what php -v returns). I can set the local version of php to php 72 in cpanel but php -v still indicates I have 70, when I run phpinfo.php it shows php 72 running locally. In order to install Magento 2.3 using the CLI I have had to use a full path to the binary for php 7.2 in front of bin/magento commands. The results seems to run with no problem. My question is does this situation with php cause any issues during runtime or development? If so what do I need to do?

1 Answer 1

0

Looks like you cli using old php.ini

You can specify the php.ini file in command line by using the following syntax:

php -c [Path to php.ini file] [Path to .php file]

For Example:

php -c /home/userna5/public_html/php.ini /home/userna5/public_html/example.php

And you also need to change php settings. Use command:

php -c [Path to php.ini file] [Path to .php file] -d [PHP setting]

For Example:

php -c /home/userna5/public_html/php.ini /home/userna5/public_html/example.php -d memory_limit=256M

Reference: https://www.inmotionhosting.com/support/www.inmotionhosting.com/support/website/php/command-line-settings

2
  • Thanks for your reply. My question is more about whether there is anything to account for when you are not using CLI. When the Magento 2.3 website is running and I navigate between pages I assume I need php 72 not 7.0. If local php is 72 and server version is 7.0 will the website run ok or do I need to do something. Same question when creating a new php file which version of php will it run under? Commented Mar 18, 2019 at 12:48
  • your server conf/host file pointing to right php version i.e, 7.2 That's why when you run phpinfo on web you can see 7.2. Whereas your CLI is using old PHP verson 7.0, and from my answer you can change your php version for CLI. It won't be a problem if you do nothing on CLI, because your web is pointing to correct php version Commented Mar 19, 2019 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.