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:
-
- 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);
- // }
- }
-
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:
# 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 like this.
- date_default_timezone_set('UTC');
- return gmdate('Y-m-d H:i:s', $timestamp + 28800) ;
- #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. .
# 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 codes. The reason is that the official has been suspended, and it takes 30 seconds to check the upgrade.
- # After exiting now, then Log in to visit and see if it has opened instantly?
- # Let’s try it.
-
Copy the code
|