<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                1.官網下載最新版本,移動到官網下載頁面:[https://www.php.net/downloads.php](https://links.jianshu.com/go?to=https%3A%2F%2Fwww.php.net%2Fdownloads.php%23v7.3.5)。鼠標移動到要下載的版本超鏈接文案,審查頁面元素獲取鏈接。 這里以7.3.8為例:https://www.php.net/distributions/php-7.3.8.tar.gz ``` wget -P /usr/local/src/ https://www.php.net/distributions/php-7.3.8.tar.gz // -P參數用來指定下載到哪個目錄下 ``` 2.配置編譯參數,比如官方擴展庫的安裝與否,安裝文件,配置文件等的路徑等等。 ./configure --help 會有所有參數的作用解釋 網上有中文翻譯版。以下版本為網上借鑒,并實踐后解決了其中的部分錯誤后整理所得。 ``` > useradd www > groupadd www ``` ``` ./configure --prefix=/usr/local/php7 \ --with-config-file-path=/usr/local/php7 \ --with-fpm-user=www \ --with-fpm-group=www \ --with-curl=/usr/local/php7/curl \ --with-openssl-dir=/usr/local/php7/openssl \ --with-openssl \ --enable-sockets \ --enable-fpm \ --enable-cli \ --enable-mbstring \ --enable-pcntl \ --enable-soap \ --enable-opcache \ --enable-fileinfo \ --disable-rpath \ --enable-mysqlnd \ --with-mysqli \ --with-pdo-mysql \ --with-iconv-dir \ --with-mhash \ --with-gd=no \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --enable-zip \ --with-zlib \ --enable-simplexml \ --with-libxml-dir //配置檢查過程中會報各種: #1 configure: error: libxml2 not found. Please check your libxml2 installation. yum install libxml2 libxml2-devel //那么缺什么庫就使用yum安裝,然后再執行上面的編譯配置 #2 configure: error: Cannot find OpenSSL's <evp.h> yum install openssl openssl-devel //依然報上面的錯誤 改--with-openssl=/usr/local/php7/openssl => --with-openssl=/usr/local/php7/openssl-dir #3 configure: error: Please reinstall the libzip distribution yum install libzip libzip-devel #4 checking for libzip... configure: error: system libzip must be upgraded to version >= 0.11 yum remove -y libzip //移除舊版本的libzip庫,源碼安裝最新版本(需要cmake) yum install wget wget -P /usr/local/src/ https://libzip.org/download/libzip-1.5.2.tar.gz cd /usr/local/src/ tar -vxf libzip-1.5.2.tar.gz cd libzip-1.5.2 mkdir build && cd build && cmake .. && make && make install #5 CMake Error at CMakeLists.txt:4 (CMAKE_MINIMUM_REQUIRED): #6 CMake 3.0.2 or higher is required. You are running version 2.8.12.2 yum remove -y cmake wget -P /usr/local/src/ https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz cd /usr/local/src/ tar -vxf cmake-3.15.2.tar.gz cd cmake-3.15.2 ./configure --prefix=/usr/local/cmake-3.15.2 make make install // 我在cmke的編譯過程中沒有遇到報錯。最后檢測 cmake --version #7 -bash: /usr/bin/cmake: No such file or directory ln -s /usr/local/cmake-3.15.2/bin/cmake /usr/bin/cmake //再執行cmake --version 顯示cmake version 3.15.2 vim /root/.bashrc # 增加別名定義 alias cmake='/usr/local/cmake-3.15.2/bin/cmake'保存 source /root/.bashrc //立刻生效配置 //那么我們再回到libzip的cmake安裝 把問題#4 下的方案在執行一遍 cd /usr/local/src/libzip-1.5.2 rm -rf build mkdir build && cd build cmake .. #8 -- Could NOT find NETTLE (missing: NETTLE_LIBRARY NETTLE_INCLUDE_DIR) #-- Could NOT find GnuTLS (missing: GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR) #-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) #CMake Warning at CMakeLists.txt:218 (MESSAGE): # -- bzip2 library not found; bzip2 support disabled #-- Configuring done #-- Generating done #-- Build files have been written to: /usr/local/src/libzip-1.5.2/bulid yum install bzip2 bzip2-devel //再來一次 make ..少了Cmake警告 那兩個無法找到的庫 好像是用來加密的 網上資料很少 我無視直接編譯安裝了 make make install // 成功 再回到php配置編譯參數執行 #9 configure: error: off_t undefined; check your library configuration vim /etc/ld.so.conf //添加內容 /usr/local/lib64 /usr/local/lib /usr/lib /usr/lib64 //保存并退出 :wq ldconfig -v # 使之生效 成功 再回到php配置編譯參數執行 #10 configure: error: Cannot find OpenSSL's <evp.h> //這個問題又出現了 蛋疼 //網上看了半天沒有解決方案 最后又加了一行 --with-openssl \ 就好了 真他媽神奇 看來編譯配置參數的解釋要去好好看看 #11 # configure: error: Please reinstall the libcurl // yum -y install curl-devel ``` &nbsp; 3 編譯和安裝 ``` make test // 結果運行了很久 最后報告顯示還有不少測試錯誤 以為出問題了也不知道怎么處理 //后來網上說 只要配置參數部分成功完成 這步可以忽略 有寫測試指標依賴于環境 主要是給官方做免費測試用的 make && make install //出現以下結果為編譯成功 Build complete. Don't forget to run 'make test'. Installing shared extensions: /usr/local/php7/lib/php/extensions/no-debug-non-zts-20180731/ Installing PHP CLI binary: /usr/local/php7/bin/ Installing PHP CLI man page: /usr/local/php7/php/man/man1/ Installing PHP FPM binary: /usr/local/php7/sbin/ Installing PHP FPM defconfig: /usr/local/php7/etc/ Installing PHP FPM man page: /usr/local/php7/php/man/man8/ Installing PHP FPM status page: /usr/local/php7/php/php/fpm/ Installing phpdbg binary: /usr/local/php7/bin/ Installing phpdbg man page: /usr/local/php7/php/man/man1/ Installing PHP CGI binary: /usr/local/php7/bin/ Installing PHP CGI man page: /usr/local/php7/php/man/man1/ Installing build environment: /usr/local/php7/lib/php/build/ Installing header files: /usr/local/php7/include/php/ Installing helper programs: /usr/local/php7/bin/ program: phpize program: php-config Installing man pages: /usr/local/php7/php/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /usr/local/php7/lib/php/ [PEAR] Archive_Tar - installed: 1.4.7 [PEAR] Console_Getopt - installed: 1.4.2 [PEAR] Structures_Graph- installed: 1.1.1 [PEAR] XML_Util - installed: 1.4.3 [PEAR] PEAR - installed: 1.10.9 Wrote PEAR system config file at: /usr/local/php7/etc/pear.conf You may want to add: /usr/local/php7/lib/php to your php.ini include_path /usr/local/src/php-7.3.8/build/shtool install -c ext/phar/phar.phar /usr/local/php7/bin ln -s -f phar.phar /usr/local/php7/bin/phar Installing PDO headers: /usr/local/php7/include/php/ext/pdo/ ``` &nbsp; 4 添加PHP命令目錄到環境變量 有點類似于類的自動加載,輸入php 則會在環境變量里的目錄查找是否有php這個執行文件,如果有就直接執行,達到php 替代 /usr/local/php7/bin/php 的簡化作用 ``` vim /etc/profile //在文件末尾加入 PATH=$PATH:/usr/local/php7/bin/ export PATH //保存并退出 source /etc/profile //立刻生效配置 //測試php命令 php -v //顯示以下為成功 這樣 PHP 7.3.8 (cli) (built: Aug 11 2019 18:55:14) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies ``` &nbsp; 5.配置php-fpm ``` // 復制php.ini到編譯配置參數指定的目錄。php.ini在解壓的源碼目錄里 cp /usr/local/src/php-7.3.8/php.ini-production /usr/local/php7/php.ini // 復制一份php-fpm的配置模版文件到同級目錄 方便備份和修改 cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf // 復制一份php-fpm的擴展配置模板文件到同級目錄 方便備份和修改 cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf // 復制開啟自起腳本到系統啟動自動加載腳本目錄。fpm/init.d.php-fpm在解壓的源碼目錄里 cp /usr/local/src/php-7.3.8/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm // 使開機自起腳本可被任何權限角色執行 chmod +x /etc/init.d/php-fpm ``` 6.關于配置文件的一些說明 參考:https://www.cnblogs.com/xiaozong/p/5724984.html php-fpm.conf是PHP-FPM特有的配置文件 php.ini是所有php模式中必須的配置文件 兩者的區別是,php-fpm.conf是PHP-FPM進程管理器的配置文件,php.ini是PHP解析器的配置文件 有的PHP版本的配置文件路徑中還有/fpm.d/www.conf配置文件 這是php-fpm.conf配置的文件的擴展文件,可以打開php-fpm.conf文件查看 ; include=fpm.d/*.conf 我們可以使用php-fpm.conf配置慢日志 我們是可以開啟慢日志功能的。 slowlog = /usr/local/var/log/php-fpm.log.slow request_slowlog_timeout = 5s ``` > mkdir -p /usr/local/var/log/ > touch /usr/local/var/log/php-fpm.log.slow > chmod -R 0777 /usr/local/var/log ``` 不這樣后面啟動php-fpm會失敗 因為安裝php時編譯參數指定了php-fpm使用www賬戶 當某個請求的時間超過了5秒,就會在慢日志中記錄相應的記錄,注意上面的時間5s,不能忽略了單位,相應的還有其他單位,m分,h時(當然,這這樣做太扯淡了) php-fpm慢日志會記錄下進程號,腳本名稱,具體哪個文件哪行代碼的哪個函數執行時間過長: [21-Nov-2016 10:30:38] [pool www] pid 11877 script_filename = /var/www/ceshi/c.php [0xb70fb88c] sleep() /var/www/ceshi/c.php:2 通過日志,我們就可以知道第2行的sleep 函數有點問題,這樣我們就能追蹤問題了。 &nbsp; 7.php.ini的絕對路徑獲取 ``` php --ini ``` &nbsp; 8.擴展安裝檢查 ``` php -m ```
                  <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>

                              哎呀哎呀视频在线观看