Solution to slow phpmyadmin access

Source: Internet
Author: User

The Final Cause of slow loading of phpmyadmin4 series is that phpmyadmin's official website is not frequently opened recently, and the phpmyadmin page automatically checks the official online program version updates, so when you go to the phpmyadmin Management page and click the database, phpmyadmin keeps trying to connect to the official website, which slows down the entire open process.

The final solution is to prevent phpmyadmin from checking for updates and find the version_check.php file in the phpmyadmin directory. The specific modification is as follows:
Copy codeThe Code is 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 to cancel the phpmyadmin connection to the official website version. json by commenting out the section in the middle of else {...} to check for updates

After the modification, phpmyadmin immediately returns to the second.

Appendix: Solution for another netizen

Copy codeThe Code is as follows:
Step 1:
# File name./libraries/Util. class. php file.

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

# Replace it with the following code:
If (extension_loaded ('gettext '))
Return strftime ($ date, $ timestamp );

# Set this in China.
Date_default_timezone_set ('utc ');
Return gmdate ('Y-m-d H: I: s', $ timestamp + 28800 );

# Principle: gettext is required to format the localization time. If this function is not enabled in your environment, garbled characters will be returned, affecting the processing of phpmyadmin ajax. this test is passed in the phpmyadmin 4.0.2 php 5.5.0 environment.


# Step 2:./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 website has been suspended, which takes 30 seconds to check the upgrade.

# After exiting, log on to the system again to see if it has been enabled in seconds?
# 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.