Solution to phpmyadmin4+ opening access very slowly_PHP tutorial

WBOY
Release: 2016-07-13 10:43:27
Original
962 people have browsed it

Many friends find that when using phpmyadmin4.0 or above, they will find that opening is much slower than before. Friends who have used dedecms will encounter the same problem. The solution to dedecms is that remote files are loaded, and phpmyadmin4 also operates in the same way. , so we just need to find the code and delete it.

Many people have found that the speed seems to be much slower after using phpmyadmin4 and later versions. In summary, we provide solutions.
1. Modify localization time

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 the phpmyadmin 4.0.2 php 5.5.0 environment. .
Modify: ./libraries/Util.class.php file

return gmdate('Y-m-d H:i:s', $timestamp + 28800);
The code is as follows
 代码如下 复制代码
# 查找
return strftime($date, $timestamp);
 
# 替换成如下代码:
if(extension_loaded('gettext'))
  return strftime($date, $timestamp);
 
# 中国区这样设置.
date_default_timezone_set('UTC');
return gmdate('Y-m-d H:i:s', $timestamp + 28800);
Copy code

# Find

return strftime($date, $timestamp);

# Replace with the following code:

if(extension_loaded('gettext'))

Return strftime($date, $timestamp);
 代码如下 复制代码
$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);
}

# China area is set up like this.

date_default_timezone_set('UTC');

2. Block online upgradesPrinciple: The official website of phpmyadmin is GFW. The time to automatically check for updates is wasted waiting in the wall. Just close it Modify: ./version_check.php file, delete or comment out the following codes
The code is as follows Copy code
$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);
} After logging out now, log in again to see if it has opened instantly? Let’s try it~ http://www.bkjia.com/PHPjc/633184.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/633184.htmlTechArticleMany friends find that when using phpmyadmin4.0 or above, they will find that opening is much slower than before. If you have used dedecms, Friends will encounter the same problem. The problem is that dedecms is loaded...
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