I have installed composer on my cpanel(which has a global php version 5.6). Currently, i am in a subfolder which is under my sub-domain. My sub-domain has a php version 7. This subfolder contains my project. When i try to run my project, i get a 500 internal error
Looking in my error log in my cpanel, i see this error Call to undefined function Symfony\\Polyfill\\Mbstring\\iconv_strpos()
. I tried this in my terminal composer require symfony/polyfill-iconv
but i keep getting this another error
This package requires php >=7.0.0 but your PHP version (5.6.32) does not satisfy that requirement.
I have upgraded the php version for my sub-domain but why is the composer not able to recognize that?
Type php -v in console. This command show php version. If it shows old php, you can change default php version just execute:
sudo update-alternatives --set php /usr/bin/php7.2
change to your php version number
You have to run composer in PHP7 mode for this like:
path/to/php7/php path/to/composer/composer.phar require symfony/polyfill-iconv
Or simply ignore PHP version requirement like:
composer require symfony/polyfill-iconv --ignore-platform-reqs
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.