<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                <!-- toc --> # 環境搭建 --- [TOC] # Linux環境下安裝 Linux操作系統通常都有自己的包管理軟件(Ubuntu的apt-get,CentOS的yum,Mac OSX的HomeBrew等),因此一般情況下可以通過這些包管理軟件直接安裝PHP。但是這樣安裝的PHP不太適用于運行Swoole,因此本章將介紹如何通過源碼編譯安裝。 ## 編譯環境 想要編譯安裝PHP首先需要安裝對應的編譯工具。 Ubuntu上使用如下命令安裝編譯工具和依賴包: ```shell sudo apt-get install \ build-essential \ gcc \ g++ \ autoconf \ libiconv-hook-dev \ libmcrypt-dev \ libxml2-dev \ libmysqlclient-dev \ libcurl4-openssl-dev \ libjpeg8-dev \ libpng12-dev \ libfreetype6-dev \ ``` ## PHP安裝 [PHP下載地址 Download](http://php.net/) 在這里挑選你想用的版本即可。下載源碼包后,解壓至本地任意目錄(保證讀寫權限)。 使用如下命令編譯安裝PHP: ```shell cd php-5.6.22/ ./configure --prefix=/usr/local/php \ --with-config-file-path=/etc/php \ --enable-fpm \ --enable-pcntl \ --enable-mysqlnd \ --enable-opcache \ --enable-sockets \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-shmop \ --enable-zip \ --enable-soap \ --enable-xml \ --enable-mbstring \ --disable-rpath \ --disable-debug \ --disable-fileinfo \ --with-mysql=mysqlnd \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-pcre-regex \ --with-iconv \ --with-zlib \ --with-mcrypt \ --with-gd \ --with-openssl \ --with-mhash \ --with-xmlrpc \ --with-curl \ --with-imap-ssl sudo make sudo make install sudo mkdir /etc/php sudo cp php.ini-development /etc/php/php.ini ``` 注意,以上PHP編譯選項根據實際情況可調整。 另外,還需要將PHP的可執行目錄添加到環境變量中。 使用Vim/Sublime打開~/.bashrc,在末尾添加如下內容: ```shell export PATH=/usr/local/php/bin:$PATH export PATH=/usr/local/php/sbin:$PATH ``` 保存后,終端輸入命令: ```bash source ~/.bashrc ``` 此時即可通過`php --version`查看php版本。 # Mac環境下安裝 Mac系統自帶PHP,但是Mac上對于OpenSSL的相關功能做了一些限制,使用了一個`Secure Transport`來取代OpenSSL。因此仍然建議重新編譯安裝PHP環境。 ## 安裝OpenSSL Mac原裝的0.9.8版本的OpenSSL使用的時候會有些Warning,反正我看不慣…… 安裝命令: ```shell brew install openssl ``` 安裝之后,還需要鏈接新的openssl到環境變量中。 ```shell brew link --force openssl ``` ## 安裝Curl Mac系統原裝的Curl默認使用了Secure Transport,導致通過option函數設置的證書全部無效。果斷重新安裝之。 ```shell brew install curl --with-openssl && brew link curl --force ``` ## 安裝PHP PHP官網上下載某個版本的PHP(我選擇的是5.6.22),使用如下命令編譯安裝。 ```shell cd /path/to/php/ ./configure --prefix=/usr/local/php --with-config-file-path=/etc/php --with-openssl=/usr/local/Cellar/openssl/1.0.2g/ --with-curl=/usr/local/Cellar/curl/7.48.0/ make && make install ``` 這里我僅列出兩個需要特殊設置的選項`with-openssl`和`with-curl`。 安裝完成后,執行如下命令: ```shell sudo cp /usr/local/php/bin/php /usr/bin/ sudo cp /usr/local/php/bin/phar* /usr/bin/ sudo cp /usr/local/php/bin/php-config /usr/bin/ sudo cp /usr/local/php/bin/phpize /usr/bin/ ``` 隨后,設置php.ini ```shell sudo mkdir /etc/php sudo cp php.ini.development /etc/php/php.ini ``` # Swoole擴展安裝 [Swoole擴展下載地址 Download](https://github.com/swoole/swoole-src/releases) 解壓源碼至任意目錄,執行如下命令: ```shell cd swoole-src-swoole-1.7.6-stable/ phpize ./configure sudo make sudo make install ``` > swoole的./configure有很多額外參數,可以通過./configure --help命令查看,這里均選擇默認項) 安裝完成后,進入/etc/php目錄下,打開php.ini文件,在其中加上如下一句: ```bash extension=swoole.so ``` 隨后在終端中輸入命令`php -m`查看擴展安裝情況。如果在列出的擴展中看到了swoole,則說明安裝成功。 查看swoole版本 ``` php --ri swoole ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看