84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
使用php7.0,Apache+mysql开发laravel程序,但是每次请求的时间很长,1秒多,扩展了opcache也没能解决,应该怎么办。
代码如下:(数据表中的数据20条)
$test = DB::table('cats')->select('id','price'); $a= $test->get(); dd($a);
这里 dd($test)的话,时间是380ms,我该怎么做,求指点
Turn off xDebugExtension
xDebug
config/app.php中,关掉BarryvdhDebugbar
config/app.php
BarryvdhDebugbar
config/app.php关闭无用的ServiceProvider
ServiceProvider
Executephp artisan route:cache cache the route
php artisan route:cache
If none of the above are solved, then consider whether there is a problem with the database connection.
Database connection problem. If you are using localhost, try changing to 127.0.0.1
Turn off
xDebug
Extensionconfig/app.php
中,关掉BarryvdhDebugbar
config/app.php
关闭无用的ServiceProvider
Execute
php artisan route:cache
cache the routeIf none of the above are solved, then consider whether there is a problem with the database connection.
Database connection problem. If you are using localhost, try changing to 127.0.0.1