Question

How to enable php-mbstring and php-soap on my Ubuntu 18.04 droplet

Posted February 14, 2020 2.8k views
PHPLAMP Stack

Running WordPress w/WooCommerce on a Ubuntu 18.04 droplet with PHP 7.4.2.

A WooCommerce Square payment add-in is not accepting payments.

The WooCommerce website status is reporting 2 errors:

Your server does not support the mbstring functions - this is required for better character encoding. Some fallbacks will be used instead for it.
Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.

Both php-mbstring and php-soap are installed.

A php -i | grep soap command returns:

/etc/php/7.4/cli/conf.d/20-soap.ini,
soap
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400

A php -i | grep mbstring command returns:

/etc/php/7.4/cli/conf.d/20-mbstring.ini,
Zend Multibyte Support => provided by mbstring
Multibyte decoding support using mbstring => enabled
mbstring
mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.
mbstring.detect_order => no value => no value
mbstring.encoding_translation => Off => Off
mbstring.func_overload => 0 => 0
mbstring.http_input => no value => no value
mbstring.http_output => no value => no value
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml)
mbstring.internal_encoding => no value => no value
mbstring.language => neutral => neutral
mbstring.regex_retry_limit => 1000000 => 1000000
mbstring.regex_stack_limit => 100000 => 100000
mbstring.strict_detection => Off => Off
mbstring.substitute_character => no value => no value

I was told by WooCommerce support the line:

mbstring.encoding_translation => Off => Off

Is the problem.

I do not know how to fix or troubleshoot this problem. Thank you in advance for any help you can provide!

edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @mdkennedy,

It does seem like you have mbstring and SOAP enabled on your PHP version. It’s possible however your website is actually picking up another PHP version. You can confirm this by creating a info.php file in your website’s DocumentRoot.

The info file will provide you with all the PHP settings,configurations your website is using. To create it just add an info.php file in your website’s directory and type in the following inside it

<?php

phpinfo();

It should say which PHP version is picking up and help you determine if you actually have mbstring for the said website.

Regards,
KDSys

  • You were correct, the OS reports PHP version 7.4.2 is installed and enabled. WordPress/WooCommerce thinks version 7.2.27 is installed and enabled. NO WONDER I’m having problems!

    Thank you for the advice and suggestion! I’ve opened a new issue with WordPress/WooCommerce with this information.

    I consider this issue request - CLOSED

Submit an Answer