The following column phpmyadmin usage tutorial will introduce to you how to completely solve the lag problem of phpmyadmin local application. I hope it will be helpful to friends in need!
When using phpmyadmin, you often encounter slow response. It takes about 3-4 seconds to access a page. Looking for the reason, there are different answers on the Internet. Some said that it is requesting the server verification script and that some code in version_check.php needs to be commented out. I did so, but it didn't work. Others said that the return time in Util.class.php needs to be modified. I Doing so also doesn't work.
Recommended tutorial: PHPMyAdmin
I have no choice but to open the debugging tool and find out where this will happen. The tool has become so slow. When I open the network, I see two requests. The return time of each access is more than 2 seconds. One is index.php and the other is sql.php. Breakpoint debugging (the stupidest way, exit) ;
Finally traced to ./Libraries/classes/Dbi/DbiMysqli..phpThe mysqli_real_connect() method in this file takes 1 time each time For more than seconds, print out the incoming parameters and find that the $host parameter uses localhost and change it to 127.0.0.1 (config.inc.php (Modify in Medium), it opens immediately, the feeling of lag disappears, everything is fresh and natural, and extremely comfortable;
But why is mysqli_real_connect using localhost slower than '127.0.0.1'? localhost != 127.0.0.1?
Continue to check the information: Check the official manual mysqli_real_connect function: http://php.net/manual/zh/mysqli.real-connect.php
Note:
host can use domain name and IP address. If NULL or the string "localhost" is passed then the channel will be used instead of TCP/IP to connect to the local server.
I did not use --enable-named-pipe when I started the MySQL service locally, so I could not use pipe to connect to the server. I used TCP/ip to connect, which would of course change. slow! !
The above is the detailed content of Completely solve the lag problem of phpmyadmin local application. For more information, please follow other related articles on the PHP Chinese website!