Skip to main content

Check and install php7.0-mbstring extention on Ubuntu 16.04 and Microsoft Windows

While learning Facebook SDK for PHP I overlooked one of system requirements preventing my code from running on my host. That is The mbstring extension.
Facebook SDK for PHP's system requirements
Facebook SDK for PHP's system requirements

Check if mbstring is enabled

root@ubuntu001:~# php -a
Interactive mode enabled

php > echo extension_loaded('mbstring');
php >exit


root@ubuntu001:~# apt-cache search php7 | grep mbstring
php7.0-mbstring - MBSTRING module for PHP
root@ubuntu001:~#

Install php7.0-mbstring

root@ubuntu001:~# apt-get install php7.0-mbstring
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0
  libjpeg-turbo8 libjpeg8 libmcrypt4 libtiff5 libvpx3 libxpm4
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-dev php7.0-fpm
  php7.0-json php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml
The following NEW packages will be installed:
  php7.0-mbstring
The following packages will be upgraded:
  libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-dev php7.0-fpm
  php7.0-json php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml
10 upgraded, 1 newly installed, 0 to remove and 99 not upgraded.
Need to get 5,797 kB of archives.
After this operation, 1,497 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-mysql amd64 7.0.8-0ubuntu0.16.04.3 [124 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-xml amd64 7.0.8-0ubuntu0.16.04.3 [112 kB]
Get:3 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-json amd64 7.0.8-0ubuntu0.16.04.3 [16.8 kB]
Get:4 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-opcache amd64 7.0.8-0ubuntu0.16.04.3 [75.9 kB]
Get:5 http://mirrors.digitalocean.com/ubuntu xenial-updates/universe amd64 php7.0-fpm amd64 7.0.8-0ubuntu0.16.04.3 [1,287 kB]
Get:6 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-readline amd64 7.0.8-0ubuntu0.16.04.3 [12.8 kB]
Get:7 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-dev amd64 7.0.8-0ubuntu0.16.04.3 [379 kB]
Get:8 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-cli amd64 7.0.8-0ubuntu0.16.04.3 [1,279 kB]
Get:9 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 libapache2-mod-php7.0 amd64 7.0.8-0ubuntu0.16.04.3 [1,224 kB]
Get:10 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 php7.0-common amd64 7.0.8-0ubuntu0.16.04.3 [822 kB]
Get:11 http://mirrors.digitalocean.com/ubuntu xenial-updates/universe amd64 php7.0-mbstring amd64 7.0.8-0ubuntu0.16.04.3 [463 kB]
Fetched 5,797 kB in 0s (22.3 MB/s)
(Reading database ... 87692 files and directories currently installed.)
Preparing to unpack .../php7.0-mysql_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-mysql (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-xml_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-xml (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-json_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-json (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-opcache_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-opcache (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-fpm_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-fpm (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-readline_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-readline (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-dev_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-dev (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-cli_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-cli (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../libapache2-mod-php7.0_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Preparing to unpack .../php7.0-common_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-common (7.0.8-0ubuntu0.16.04.3) over (7.0.8-0ubuntu0.16.04.2) ...
Selecting previously unselected package php7.0-mbstring.
Preparing to unpack .../php7.0-mbstring_7.0.8-0ubuntu0.16.04.3_amd64.deb ...
Unpacking php7.0-mbstring (7.0.8-0ubuntu0.16.04.3) ...
Processing triggers for systemd (229-4ubuntu7) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up php7.0-common (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-mysql (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-xml (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-json (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-opcache (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-readline (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-cli (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-fpm (7.0.8-0ubuntu0.16.04.3) ...
Setting up php7.0-dev (7.0.8-0ubuntu0.16.04.3) ...
Setting up libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.3) ...
apache2_invoke php7.0: already enabled
Setting up php7.0-mbstring (7.0.8-0ubuntu0.16.04.3) ...
Creating config file /etc/php/7.0/mods-available/mbstring.ini with new version
Processing triggers for libapache2-mod-php7.0 (7.0.8-0ubuntu0.16.04.3) ...
Processing triggers for php7.0-fpm (7.0.8-0ubuntu0.16.04.3) ...
root@ubuntu001:~#

Check if mbstring is enabled

root@ubuntu001:~# php -a
Interactive mode enabled

php > echo extension_loaded('mbstring');
1
php>exit

root@ubuntu001:~#


On Microsoft Windows Operating System

Edit php.ini (C:\Program Files\PHP\v7.0\php.ini)

Uncomment the following line in php.ini file
extension=php_mbstring.dll

Check with phpinfo();

Check if php_mbstring extension is enabled with phpinfo();
Check if php_mbstring extension is enabled with phpinfo();






Popular posts from this blog

Tiếng Nhật: 7 ngày trong tuần

Tìm thấy món quà xinh xắn mà một đồng nghiệp đã tặng trong dịp đi Nhật tham gia khóa học quản lý dự án. Desk Calendar in Japanese Thử một mục tiêu nhỏ để luyện tập não và cách gõ tiếng Nhật trên máy tính. Dưới đây là bảy ngày trong tuần, bắt đầu từ Chủ Nhật, đến thứ hai,... và cuối cùng là thứ bảy (Nhựt, Nguyệt, Hỏa, Thủy, Mộc, Kim, Thổ). 日曜日 にちようび 月曜日 げつようび 火曜日 かようび 水曜日 すいようび 木曜日 もくようび 金曜日 きんようび 土曜日 どようび  [Nguồn tham khảo] http://www.cjvlang.com/Dow/dowjpn.html Cám ơn bạn đã đọc!

IBM Domino: Enable SMTPClientDebug, SMTPDebug

Add parameters to NOTES.ini SMTPClientDebug=1 SMTPDebug=2 Option 1: Add parameters via GUI IBM Domino: Enable SMTPDebug in NOTES.ini Option 2: Add parameters via command SET CONFIG "SMTPClientDebug=1" update Run command to update router configuration tell router update config IBM Domino: tell router update config to update configuration and reload routing table Send an email to @gmail.com to check result IBM Domino: Log file after enabling SMTPClientDebug parameter in NOTES.ini file

Linux command: printenv

printenv - print all or part of environment NAME        printenv - print all or part of environment SYNOPSIS        printenv [OPTION]... [VARIABLE]... DESCRIPTION        Print  the  values  of the specified environment VARIABLE(s).  If no VARIABLE is speci‐        fied, print name and value pairs for them all.        -0, --null               end each output line with NUL, not newline        --help display this help and exit        --version               output version information and exit        NOTE: your shell may have its own version of printenv,  which  usually  supersedes  the        version  described  here.  Please refer to your shell's documentation for d...