skip to Main Content

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, iget a 500 internal error

Looking in my error log in my cpanel, i see this error Call to undefined function SymfonyPolyfillMbstringiconv_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?

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search