php - 关于laravel请求响应慢的问题,怎么解决?
世界只因有你
世界只因有你 2017-05-16 12:02:04
0
2
561

使用php7.0,Apache+mysql开发laravel程序,但是每次请求的时间很长,1秒多,扩展了opcache也没能解决,应该怎么办。

代码如下:(数据表中的数据20条)

$test = DB::table('cats')->select('id','price');           
$a= $test->get();
dd($a);

这里 dd($test)的话,时间是380ms,我该怎么做,求指点

世界只因有你
世界只因有你

reply all(2)
阿神
  1. Turn off xDebugExtension

  2. config/app.php中,关掉BarryvdhDebugbar

  3. config/app.php关闭无用的ServiceProvider

  4. Executephp artisan route:cache cache the route

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!