Solution to the problem that phpmyadmin is too slow to open

WBOY
Release: 2016-07-25 09:13:22
Original
1020 people have browsed it

The final reason for the slow loading of the phpmyadmin4 series is that the official website of phpmyadmin often cannot be opened recently, and the phpmyadmin page will automatically check the program version update on the official website, so when you enter the phpmyadmin management page and click on the database, phpmyadmin has been trying to connect to the official website. Makes the entire opening process very slow.

Solution: To prevent phpmyadmin from checking for updates, find the version_check.php file in the phpmyadmin directory.

Specific modifications:

  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. }
Copy code

The above code is to cancel the phpmyadmin connection to the official website version.json by commenting out the else{...} middle section to check for updates After the modification, phpmyadmin immediately returned to open in seconds.

Attached, another netizen’s solution first step:

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

  2. # Find
  3. return strftime($date, $timestamp);
  4. # Replace with the following code:
  5. if(extension_loaded ('gettext'))
  6. return strftime($date, $timestamp);
  7. # China area is set like this.
  8. date_default_timezone_set('UTC');
  9. return gmdate('Y-m-d H:i:s', $timestamp + 28800) ;
  10. #Principle: Localized time formatting requires gettext support. If this function is not enabled in your environment, garbled characters will be returned, affecting #phpmyadmin ajax processing. This test was verified on 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 codes. The reason is that the official has been suspended, and it takes 30 seconds to check the upgrade.
  22. # After exiting now, then Log in to visit and see if it has opened instantly?
  23. # Let’s try it.

Copy the code


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template