Phpmyadmin-php Tutorial

Source: Internet
Author: User
Phpmyadmin is too slow to open

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.

Solution: Do not let phpmyadmin check for updates. find the version_check.php file in the phpmyadmin directory.

Specific modification:

  1. If (isset ($ _ SESSION ['cache'] ['version _ check'])
  2. & Time () <$ _ SESSION ['cache'] ['version _ check'] ['timestamp'] + 3600*6
  3. ){
  4. $ Save = false;
  5. $ Response = $ _ SESSION ['cache'] ['version _ check'] ['response'];
  6. } Else {
  7. // $ Save = true;
  8. // $ File = 'http: // www.phpmyadmin.net/home_page/version.json ';
  9. // If (ini_get ('allow _ url_fopen ')){
  10. // $ Response = file_get_contents ($ file );
  11. //} Else if (function_exists ('curl _ init ')){
  12. // $ Curl_handle = curl_init ($ file );
  13. // Curl_setopt ($ curl_handle, CURLOPT_RETURNTRANSFER, 1 );
  14. // $ Response = curl_exec ($ curl_handle );
  15. //}
  16. }

The code above cancels the phpmyadmin connection to the official website version. json by commenting out the section in the middle of else {...} to check that phpmyadmin will return to the second after the update and modification.

Appendix, the first step of another netizen's solution:

  1. # File name./libraries/Util. class. php file.

  2. # Search
  3. Return strftime ($ date, $ timestamp );
  4. # Replace it with the following code:
  5. If (extension_loaded ('gettext '))
  6. Return strftime ($ date, $ timestamp );
  7. # Set this in China.
  8. Date_default_timezone_set ('utc ');
  9. Return gmdate ('Y-m-d H: I: S', $ timestamp + 28800 );
  10. # 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.

  11. # Step 2:./version_check.php file.

  12. $ Save = true;
  13. $ File = 'http: // www.phpmyadmin.net/home_page/version.json ';
  14. If (ini_get ('allow _ url_fopen ')){
  15. $ Response = file_get_contents ($ file );
  16. } Else if (function_exists ('curl _ init ')){
  17. $ Curl_handle = curl_init ($ file );
  18. Curl_setopt ($ curl_handle, CURLOPT_RETURNTRANSFER, 1 );
  19. $ Response = curl_exec ($ curl_handle );
  20. }
  21. # 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.
  22. # After Exiting, log on to the system again to see if it has been enabled in seconds?
  23. # 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.