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

MSSQL: Fix error 'Consistency validation for SQL Server registry keys'

While installing Microsof SQL Server 2012, I ran into the following error. "The SQL Server registry keys from a prior installation cannot be modified. To continue, see SQL Server Setup documentation about how to fix registry keys." How to fix Replace the D:\x64\FixSqlRegistryKey_x86.exe file with the original file from the ENU\SQLFULL_ENU.iso file downloading from Microsoft Download Center. This ISO file is 4.2GB. So you can click FixSqlRegistryKey_x86.exe to download this file only. After replacing that file, press Re-run to check. All rules are passed.

IBM Domino: How to enable HTTP Request logging in Domino

http://www-01.ibm.com/support/docview.wss?uid=swg21099151 Technote (FAQ) Question How do you enable HTTP request logging when using a Lotus® Domino® Web server? You want a record of all requests sent by Web browsers to the Domino server to use for troubleshooting. Answer Below is a short guide to turning on request logging that provides the basic logging level. More verbose logging can be enabled by following the instructions in  "Overview of HTTP Request Logs" (#7003598) . Important:  HTTP request logging should be used only for troubleshooting specific issues, and usually at the direction of and with assistance from IBM Support. Do not use request logging for other purposes, such as administrative reasons. Because these log files grow in size over time, you should not leave this setting enabled for long periods or you will exhaust the available drive space. To enable logging of HTTP requests for a Domino server for the current HTTP session only, enter the f

Linux command: swapon

Two ways to check if swap partition exists.