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

                ## 1、下載PHP源代碼 首先需要從PHP官網下載PHP7.3.6的源代碼,[點擊下載]() 下載到自己存放的目錄當中 ![](https://i.vgy.me/vmAxnF.png) ![](https://i.vgy.me/o5rdDv.png) ``` 解壓 tar -zxf php-7.3.6.tar.gz 進入目錄 cd php-7.3.6 ``` ## 2、安裝依賴 ``` sudo apt update sudo apt install gcc sudo apt install make sudo apt install openssl sudo apt install curl sudo apt install libbz2-dev sudo apt install libxml2-dev sudo apt install libjpeg-dev sudo apt install libpng-dev sudo apt install libfreetype6-dev sudo apt install libzip-dev ``` >[danger] 安裝好這些依賴,可能還會出現一些依賴不存在的錯誤,到時候有什么提示錯誤,百度搜索安裝即可 ## 3、配置PHP ``` ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts ``` >[success] +--------------------------------------------------------------------+| License: || This software is subject to the PHP License, available in this || distribution in the file LICENSE. By continuing this installation || process, you are bound by the terms of this license agreement. || If you do not agree with the terms of this license, you must abort || the installation process at this point. |+--------------------------------------------------------------------+ > Thank you for using PHP. > 在這一步中,如果出現無法找到某個依賴的情況,可以嘗試使用sudo apt install來重新安裝一下沒有找到的依賴 ``` configure: error: Cannot find OpenSSL's 這個問題是缺少openssl-devel?apt-get install libssl-dev 安裝即可 checking for cURL 7.15.5 or greater... configure: error: cURL version 7.15.5 or later is required to compile php with cURL support 這個問題是cURL版本問題解除安裝重灌下curl就好了 sudo apt-get install curl libcurl3 libcurl3-dev configure: error: DBA: Could not find necessary header file(s). 網上找了半天都說是少了這個包 libdb-dev 我的卻不行 安裝?libgdbm-dev 這個包才ok Configure: error: libpng.(also) not found. apt-get install libjpeg-dev libpng-dev configure: error: freetype-config not found. apt-get -y install libfreetype6-dev configure: error: Please reinstall the libzip distribution apt install libzip-dev ``` >[danger] 途中可能出現N種錯誤,但是不要慌,百度谷歌慢慢搞!!! ## 4、編譯并安裝PHP 在完成配置后,可以直接使用make來進行編譯,可以使用參數-j來指定編譯線程數量來多線程編譯 ``` make -j4 ``` 編譯需要一段比較長的時間,請稍作等待,編譯成功后會輸出如下內容 ``` Build complete.Don't forget to run 'make test'. ``` 然后執行以下命令進行安裝 ``` sudo make install ``` 執行完成后,PHP將會被安裝到 ``` /usr/local/php/ ``` ## 5、驗證PHP 可以使用如下指令來輸出PHP的版本,來驗證是否正確安裝 ``` /usr/local/php/bin/php -v ``` 如果正確安裝,將會出現如下內容 ``` PHP 7.3.1 (cli) (built: Jan 18 2019 20:11:04) ( ZTS )Copyright (c) 1997-2018 The PHP GroupZend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies ``` 到這一步為止,PHP7.3.1便成功從源代碼編譯安裝了。 ## 6、復制php.ini 編譯安裝后的目錄并不會有現成的php.ini,需要手動復制過去。在解壓出來的源代碼目錄中,有供開發環境使用的php.ini-development和供生產環境使用的php.ini-production。輸入命令來復制(以開發環境為例) ``` sudo cp php.ini-development /usr/local/php/etc/php.ini ``` ![](https://i.vgy.me/zsUCgG.png) ### 附上查閱資料的網站鏈接 >[info] Ubuntu 安裝php 7.3遇到的錯誤:[https://www.itread01.com/content/1541669590.html](https://www.itread01.com/content/1541669590.html) > php編譯錯誤總結:[https://zhuanlan.zhihu.com/p/62145198](https://zhuanlan.zhihu.com/p/62145198) > 我在編譯安裝 PHP 時,遇到了 “freetype-config not found”的問題:[https://www.doopsky.com/ops/981.html](https://www.doopsky.com/ops/981.html) > ubuntu源碼編譯安裝php常見錯誤解決辦法:[https://blog.csdn.net/white\_\_cat/article/details/28907535](https://blog.csdn.net/white__cat/article/details/28907535) > 安裝php過程中的錯誤和解決方式 configure: error: jpeglib.h not found:[https://www.cnblogs.com/flywang/p/5256356.html](https://www.cnblogs.com/flywang/p/5256356.html) > deepin下安裝curl 附 CURL常用命令:[https://blog.csdn.net/jkxqj/article/details/52891090](https://blog.csdn.net/jkxqj/article/details/52891090) ## 7、啟動php-fpm ``` /usr/local/php/sbin/php-fpm ``` >[danger] ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2) > ERROR: failed to load configuration file '/private/etc/php-fpm.conf' > ERROR: FPM initialization failed > 啟動就會報錯,是因為在php的etc目錄下面沒有php-fpm.conf這個文件,我們需要在etc目錄下復制一個 ``` cp php-fpm.conf.default php-fpm.conf #再次運行檢查 /usr/local/php/sbin/php -t ``` >[danger] \[27-Jun-2019 22:19:57\] WARNING: Nothing matches the include pattern '/usr/local/php/etc/php-fpm.d/\*.conf' from /usr/local/php/etc/php-fpm.conf at line 143. > \[27-Jun-2019 22:19:57\] ERROR: No pool defined. at least one pool section must be specified in config file > \[27-Jun-2019 22:19:57\] ERROR: failed to post process the configuration > \[27-Jun-2019 22:19:57\] ERROR: FPM initialization failed > 檢查又報錯了,是因為我們include沒找到.conf文件,在php-fpm.d當中時 www.conf.default這個文件我們需要修改復制出來的php-fpm.conf的include ![](https://i.vgy.me/gQAVJM.png)
                  <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>

                              哎呀哎呀视频在线观看