鍍金池/ 問答/ PHP問答
你的瞳 回答

clipboard.png
首次打開的時候,花費時間也是比較長的,

clipboard.png

38個請求432kb的傳輸量。用網頁打開,或者用file_get_contect 或者curl 獲取數(shù)據(jù) 其實都有點慢。。。

如果你想提升速度的話,我覺得可以分開獲取。開三個腳本,一個獲取js css文件,一個獲取圖片,一個獲取本身頁面結構。

你好胸 回答

不太理解,你說的base64格式圖片是啥意思,我理解的base64是一種編碼方式,當然可以支持將jpg、png等格式的圖片編碼為base64格式。

后臺:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class UserController extends Controller
{

  public function store(Request $request)
  {

  // get current time and append the upload file extension to it,
  // then put that name to $photoName variable.
  $photoName = time().'.'.$request->user_photo->getClientOriginalExtension();

  /*
  talk the select file and move it public directory and make avatars
  folder if doesn't exsit then give it that unique name.
  */
  $request->user_photo->move(public_path('avatars'), $photoName);

  }
}




前臺:

{{Form::open(['route' => 'user.store', 'files' => true])}}
    {{Form::label('user_photo', 'User Photo',['class' => 'control-label'])}}
    {{Form::file('user_photo')}}
    {{Form::submit('Save', ['class' => 'btn btn-success'])}}
{{Form::close()}}

情皺 回答

圖片描述

隨便找個瀏覽器,調試一下document.getElementsByTagName('span'),里面有個style屬性,自己看

情已空 回答

你這用canvas 能壓縮?

拽很帥 回答

nginx在linux一般是用epoll, 它使用的是注冊回調函數(shù),數(shù)據(jù)準備好自動調用。這個過程其實阻塞的。master分配某個連接給worker進程,worker同一時間的阻塞的,只能處理一個請求。。還有nginx是多進程模型的

朽鹿 回答

php的數(shù)組有實現(xiàn) + 操作的方法,有的語言就不支持了,關鍵還是看對array的設計了

安淺陌 回答

你寫的代碼本職區(qū)別就是協(xié)程理念

在你這段代碼里除了多了概念,運行基本區(qū)別沒有,都是一次fgets阻塞,實際是沒有利用協(xié)程讓什么cpu

若相惜 回答

建議換一個swoole的版本試一試

巫婆 回答

讀取的時候再設一次編碼就行了

柒槿年 回答

已經解決 原因時這個類包含的內容都是私有的,所以直接調用就會報錯

只愛你 回答
server {
        listen 80;
        server_name laravel.xxx.me;

        root /home/www/laravel;
        index index_prod.html;

        location / {
                try_files $uri $uri/ index_prod.html?$query_string;
        }

        location ~ /\.ht {
                deny all;
        }
}
風畔 回答

懷疑是 nginx 的 keep alive 的超時值不足所致。建議延長相關值。可以注意觀察下載大文檔時超過多久時會出現(xiàn)這種錯誤,這個超時的時間一般固定的。根據(jù)情況增大這個參數(shù)值
具體設置可參照這個鏈接

你的問題打了 php 的標簽,所以你的nginx對應的 upstream 服務器可能 php-fpm 服務提供,同樣也要設置 php.ini 相關的參數(shù)。

離人歸 回答

elasticsearch安裝ik插件是嗎

FROM docker.elastic.co/elasticsearch/elasticsearch:5.4.1
# Add your elasticsearch plugins setup here
# Example: RUN elasticsearch-plugin install analysis-icu

RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update && apt-get install zip
RUN mkdir -p /usr/share/elasticsearch/plugins/ik
RUN cd /usr/share/elasticsearch/plugins/ik && wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.6.3/elasticsearch-analysis-ik-5.6.3.zip && unzip elasticsearch-analysis-ik-5.6.3.zip
巫婆 回答

你用的什么系統(tǒng),還有pg 版本,是不是你的用戶不對,還有依賴包沒有。