Bobcares

PHP iconv extension – How we set it up?

by | Nov 6, 2019

Searching for a better character encoding technique?

One of the best options is to use iconv Application Programming Interface. It converts character encoding with the help of Unicode conversion.

PHP also contains an iconv extension that uses iconv character set conversion facility.

At Bobcares, we often receive requests to setup iconv extension in PHP as part of our Server Management Services.

Today, let’s get deep into the iconv extension and discuss how our Support Engineers set it up for our customers.

 

Why we use PHP iconv extension?

Iconv converts character encoding by setting a unique number for every character.

The module contains an interface to iconv character set conversion facility. We use this module to transfer the character set of a string from a local character set to another character set.

This extension comes with various utility functions that help you to write multilingual scripts.

Recently, one of our customers approached us with an error related to the Magento installation. He tried to install Magento 2.0 but all his attempts showed the same error.

Required PHP extension not found: iconv

Our Support Engineers checked and found that the customer uses PHP version 7. The error occurred due to the absence of iconv PHP module.

This module is vital for the installation of Magento in all PHP 7x versions.

 

How we enable php iconv extension?

The iconv function on different systems works differently. Usually, the supported character sets depend on the iconv implementation of the system in use.

So, we need to use different methods to enable the iconv extension on different platforms.

Let’s see how our Support Engineers enable it effectively for our customers.

 

1. In Linux

It is quite easy to enable iconv extension on Linux servers.

At first, we check whether the iconv module is already present or not using the command,

php -m | grep iconv

If there is no such module, we install it using the command,

yum install php7x-iconv

After that, we restart the webserver to reflect the changes.

 

2. In Windows

Windows use dll file format to hold multiple codes and procedures for its programs. So, we first make sure that the dll file is present in the server.

To enable iconv extension, we initially open the php.ini file.

We add the entry for iconv extension,

extension=php_iconv.dll

The changes take effect when we restart the webserver.

 

3. Using cPanel

Similarly, if we have the root access, we can install iconv via WHM.

First, we log in to WHM.

Then, we choose EasyApache 4 or EasyApache 3 depending on the WHM version.

After that, choose PHP extensions from the list of options available.

Next, we choose the iconv extension based on the PHP version we use.

Finally, we click on the Provision option at the bottom of the window. And, this will install the iconv extension successfully.

 

[Need more help to enable iconv extension in PHP?- We’ll help you.]

 

Conclusion

In short, PHP iconv extension converts character encoding with the help of Unicode conversion. Also, in today’s write-up we saw how our Support Engineers enable iconv extension in various platforms.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF