Bobcares

phpMyAdmin ini_set error solved

by | Mar 6, 2020

Are you stuck with ‘phpMyAdmin ini_set error’?

Often disabling certain PHP functions like ini_get, ini_set, etc. results in phpMyAdmin error. And, when users upload databases via phpMyAdmin, it fails.

At Bobcares, we often get requests from our customers to fix phpMyAdmin ini_set error as part of our Server Management Services.

Today, let’s get into the details on how our Support Engineers fix this error.

 

What causes phpMyAdmin error ini_set?

Firstly, let’s check on the details of the ini_set function and how it causes errors.

The ini_set() function usually set the value temporarily for executing the current script. Here, the configuration option will keep the new value. The change is only in effect for the current script and will be reverted back when the script ends.

In other words, phpMyAdmin’s working relates to this function setting too.

We also use ini_set for security or optimization. However, developers use ini_set to override some options at runtime which may not be desirable.

The error mainly occurs when server owners add the ini_set() function in the disable_functions directive of the php.ini file.

For instance, the error appeared as follows.

phpmyadmin error ini_set

Let’s detail how our Support Engineers help to clear this error.

 

How to fix phpMyAdmin error ini_set?

At Bobcares, where we have more than a decade of expertise in managing servers, we see many customers face the same problem with PHP.

Now, let’s see the major reason and how our Support Engineers fix this error by editing the variable ini_set.

Altering the PHP settings of a domain counts on the mode in which PHP runs on the server. Therefore, when the customer reports the error, the primary check involves checking the server PHP mode(PHP handler).

 

Editing the main php.ini

Recently, one of the customers approached us by saying that the user was trying to upload a database backup. But the backup was in .sql format rather than .gz format. So he was trying to restore the backup via phpMyAdmin.

Unfortunately, the user was getting an error saying  ‘You have disabled ini_get and/or ini_set in php.ini. This option is incompatible with phpMyAdmin!’.

On further analysis, we could trace that the function ini_set() has been disabled in php.ini caused the problem.

We logged in to the php.ini configuration file and searched for disable_functions items. Here we could see the ini_set() function.

To resolve this problem we have removed ini_set from the list.

1. Initially, we run the following command.

cp -rp /usr/local/lib/php.ini

2. Then we opened the custom PHP file.

3. Thereafter we go to disable_functions directive and then remove ini_set from disabling the function.

4. Finally, we saved and exit.

Then, restarted the Apache service.

service apache2 restart

 

Editing PHP functions for a domain

In certain cases, due to security reasons, it may not be possible to change PHP settings in the main configuration file. Therefore, our Security Engineers recommend setting per-user restrictions for PHP functions.

Let’s now see how we edit PHP settings for a domain hosted in a SuPHP server. For this, we first set the suPHP path in the .htaccess file.

1. Firstly, we opened the .htaccess file under the public_html folder of the domain.

2. Then we added the following code into it.

suPHP_ConfigPath /home/username/public_html/

Here, we replace the username with the actual domain’s cPanel username. If there is no .htaccess file, then we have to create it and add the same code into it.

Moving on, we make changes in the custom php.ini

1. We create the php.ini file inside your public_html folder or else in the folder where the user has his script.

2. Then we write the following code into this php.ini file.

disable_functions = allow_url_fopen, escapeshellarg, escapeshellcmd, ini_alter, passthru, parse_ini_file, popen, proc_open, proc_close, proc_terminate, proc_get_status, proc_nice, readfile, show_source, system

In case if the disable_functions directive is already present, then we have to add the same code as above.

After enabling the ini_set() function the error disappears and phpMyAdmin starts working.

 

[Need more help to fix phpMyAdmin ini_set error?- We’re available 24/7.]

 

Conclusion

In short, the fix for phpMyAdmin ini_set error involves enabling the ini_set function in the PHP configuration file. Today, we saw how our Support Engineers help our customers to fix this problem.

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