phpMyAdmin Open very slow solution _php tips

Source: Internet
Author: User
Tags curl gettext phpmyadmin

The final reason for the slow loading of the PHPMYADMIN4 series is that recently phpMyAdmin's website is often not open, and the phpMyAdmin page will automatically check the official online version of the program update, So when you go into the phpMyAdmin Admin page and click on the database, phpMyAdmin has been trying to connect to the website to slow down the entire opening process.

The final solution is to not let phpMyAdmin check the update, find the phpMyAdmin directory version_check.php files, specific modifications as follows:

Copy Code code as follows:

if (Isset ($_session[' cache '] [' Version_check '])
&& time () < $_session[' cache ' [' Version_check '] [' timestamp '] + 3600 * 6
) {
$save = false;
$response = $_session[' cache '] [' version_check '] [' response '];
} else {
$save = true;
$file = ' Http://www.phpmyadmin.net/home_page/version.json ';
if (Ini_get (' Allow_url_fopen ')) {
$response = file_get_contents ($file);
else if (function_exists (' Curl_init ')) {
$curl _handle = Curl_init ($file);
curl_setopt ($curl _handle, Curlopt_returntransfer, 1);
$response = curl_exec ($curl _handle);
//    }
}

The above code is by annotating the else{...} The middle section to cancel phpMyAdmin Connection official website Version.json to check the update

After the modification, phpMyAdmin immediately returned to the second open.

Attached: a solution for another netizen

Copy Code code as follows:

First step:
# file name./libraries/util.class.php file.

# find
Return strftime ($date, $timestamp);

# Replace with the following code:
if (extension_loaded (' GetText '))
Return strftime ($date, $timestamp);

# China area is set up like this.
Date_default_timezone_set (' UTC ');
Return Gmdate (' y-m-d h:i:s ', $timestamp + 28800);

#原理: Localization time format needs GetText support, if your environment does not open this function, will return garbled, affect #phpmyadmin ajax processing. This test is validated through the phpMyAdmin 4.0.2 PHP 5.5.0 environment.


# Step two:./version_check.php file.
$save = true;
$file = ' Http://www.phpmyadmin.net/home_page/version.json ';
if (Ini_get (' Allow_url_fopen ')) {
$response = file_get_contents ($file);
else if (function_exists (' Curl_init ')) {
$curl _handle = Curl_init ($file);
curl_setopt ($curl _handle, Curlopt_returntransfer, 1);
$response = curl_exec ($curl _handle);
}
# Delete or comment out the above code. The reason is that the official has been pegged, this check upgrade takes 30 seconds.

# now after exiting, login to visit to see if the seconds have been opened?
# Everybody try it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.