Home  >  Article  >  Backend Development  >  Solution to the slow opening of phpmyadmin_PHP tutorial

Solution to the slow opening of phpmyadmin_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:31:59934browse

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 keeps trying to connect The official website thus delays the entire opening process very slowly.

The final solution is to prevent phpmyadmin from checking for updates. Find the version_check.php file in the phpmyadmin directory and modify it as follows:

Copy the code The 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);
The above code is to cancel phpmyadmin's connection to the official website version.json by commenting out the middle section of else{......} to check for updates

After the modification, phpmyadmin immediately returned to open in seconds.
Attachment: Another netizen’s solution

Copy the code

The code is as follows:

Step 1:# File name./libraries/Util.class. php file. # Search
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 your environment does not enable this function, garbled characters will be returned, affecting #phpmyadmin ajax processing. This test was verified on phpmyadmin 4.0.2 php 5.5.0 environment Passed.


# 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); This check for upgrade takes 30 seconds.

# Log out now and log in again to see if it has opened instantly?
# Let’s try it.





http://www.bkjia.com/PHPjc/756994.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/756994.html

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 on the official website is updated, so when you enter...
Statement:
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