Uncaught Error: Call to undefined function mb_detect_encoding()

I have the above error being caused by a related posts plugin. This has just started happening after updating trellis, reprovisioning the server and deploying. (everything was fine before).

the line that is throwing the error:

 			$string = utf8_encode( $string );

From looking around a few posts is seems that there are missing php extensions. mb_string(?)

This might be more a general php question, but how do I go about checking/ installing the missing extension(s)( if that is indeed the issue) in trellis?

(I'm looking in roles/php/templates/php.ini.j2 ?)

any pointers much appreciated!

I think we are missing php7.0-mbstring?


    name: "{{ item }}"
    state: present
    force: yes
  - php7.0-cli
  - php7.0-common
  - php7.0-curl
  - php7.0-dev
  - php7.0-fpm
  - php7.0-gd
  - php7.0-mcrypt
  - php7.0-mysql
  - php7.0-opcache
  - php7.0-xml
  - php7.0-xmlrpc
  - php7.0-zip
  - php7.0-mbstring```

Yeah try it out and see if it fixes it

@austin, @kalenjohnson - you guys rock, as always! That was the fix and your help is very much appreciated.

Go ahead and submit a pull-request adding that to trellis. PHP mbstring is required to run the WP unit tests and such as well.

Fixed upstream: https://github.com/roots/trellis/pull/504