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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 4.1 動手編譯PHP # 4.1 動手編譯PHP 從一個PHP程序猿,到一個想為PHP開發擴展的程序猿,此間的進化有一步是跳不過去的,那就是你必須熟知如何編譯PHP的源碼。 ### \*nix Tools C語言的編譯器是我們使用C語言的必備工具,你的系統應該已經自帶了一種C語言的編譯器,而且它極有可能是大名鼎鼎的GCC。通過檢測你本機gcc或者cc程序的版本,可以很方便的知道你機器上是否已經安裝的某種C語言的編譯器。 ``` walu@walu-ThinkPad-Edge:~$ gcc --version gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` 如果你還沒有安裝編譯器,那你需要安裝一個。最簡單的辦法便是去下載一個與你系統相符的rpm或者deb包,當然你也可以通過以下命令的一種來方便的安裝:yum install gcc, apt-get install gcc, pkg-add -r gcc, 或者 emerge gcc. 除了編譯器,你還需要以下程序:make, autoconf, automake, 和libtool。說實話,我連autoconf現在是啥還不知道(截至到現在,2011年9月6號),不過除非RP太低,一般系統中都會自備了,而且phpize程序會把這些需要的腳本給生成好的。 對于編譯需要的程序以及它們的版本我們可以在PHP官網找到最新的答案: - autoconf: 2.13 (2.59+ for PHP 5.4+) - automake: 1.4+ - libtool: 1.4.x+ (except 1.4.2) - bison: 1.28, 1.35, 1.75, 2.0 or higher - flex (PHP 5.2 and earlier): 2.5.4 (not higher) - re2c: 0.13.4+ 你千萬不要被上面的清單給嚇著,其實系統應該給裝備好了,除非真RP低,那你出門去買張彩票吧... ... 當然,我們也可以通過SVN從PHP源碼庫里導出一份源碼,需要注意的是,PHP的svn源碼庫地址是https協議的。官方推薦我們直接簽出它的php-src目錄: ``` $ svn checkout https://svn.php.net/repository/php/php-src --depth immediates php-src $ cd php-src ``` 當然,我們也可以簽出特定的版本: 11. PHP 5.3: svn checkout https://svn.php.net/repository/php/php-src/branches/PHP\_5\_3 php-src-5.3 12. PHP 5.4: svn checkout https://svn.php.net/repository/php/php-src/branches/PHP\_5\_4 php-src-5.4 13. PHP HEAD: svn checkout https://svn.php.net/repository/php/php-src/trunk php-src-trunk </ul> 最新的大家可以來這查看:<http://php.net/svn.php>### Win32 Tools 這里僅代表作者05年的觀點,我還沒有在win平臺下測試過,稍後會把這段修正過來。 `The Win32/PHP5 build system is a complete rewrite and represents a significant leap forward from the PHP4 build system. Instructions for compiling PHP4 under Windows are available on php.net, only the PHP5 build systemwhich requires Windows 2000, Windows 2003, or Windows XPwill be discussed here.`First, you'll need to grab libraries and development headers used by many of the core PHP extensions. Fortunately, many of these files are redistributed from php.net as a single .zip file located at <http://www.php.net/extra/win32build.zip>. Create a new directory named C:\\PHPDEV\\ and unzip win32build.zip using your favorite zip management program into this location. The folder structure contained in the zip file will create a subdirectory, C:\\PHPDEV\\win32build, which will contain further subfolders and files. It's not necessary to name your root folder PHPDEV; the only important thing is that win32build and the PHP source tree are both children of the same parent folder. Next you'll need a compiler. If you've already got Visual C++ .NET you have what you need; otherwise, download Visual C++ Express from Microsoft at <http://lab.msdn.microsoft.com/express/>. The installer, once you've downloaded and run it, will display the usual welcome, EULA (End-User License Agreement), and identification dialogs. Read through these screens and proceed using the Next buttons after you've agreed to the terms of the EULA and entered any appropriate information. Installation location is of course up to you, and a typical installation will work just fine. If you'd like to create a leaner installation, you may deselect the three optional componentsGUI, MSDN, and SQL Server. The final package is the Platform SDK, also available for download from Microsoft at <http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5>. The site currently lists three download options: PSDK-x86.exe, PSDK-ia64.exe, and PSDK-amd64.exe. These options refer to x86 compatible 32bit, Intel64bit, and AMD64bit processors respectively. If you're not sure which one applies to your processor, select PSDK-x86.exe, which should work cleanly, albeit less efficiently, with both 64 bit variants. As before, proceed through the first few screens as you would with any other installer package until you are prompted to select between Typical and Custom installation. A Typical installation includes the Core SDK package, which is sufficient for the purposes of building PHP. Other packages can be deselected by choosing a Custom installation, but if you have the hard disk space to spare, you might as well install it all. The other packages may come in handy later on. So unless you're byte conscious, select Typical and proceed through the next couple of standard issue screens until the installer begins copying and registering files. This process should take a few minutes so grab some popcorn. Once installation is complete you'll have a new item on your Start menuMicrosoft Platform SDK for Windows Server 2003 SP1. </pre> ### 獲取PHP源碼 其實你有很多辦法安裝PHP,最簡單的一種就是從你系統的庫或者源里通過apt-get、yum install之類的命令直接安裝PHP5,這樣做的好處你的系統可能會自動處理一些php在它上面的工作時的一些bug,而且你還可以方便的升級與卸載。這樣做也有缺點,那就是你的PHP版本永遠無法是最新的,通常www.php.net發布數周甚至數月后你才能用上相應的版本。 第二種方法:也是推薦使用的一種方法,那就是自行下載php-x.y.z.tar.gz的源碼包,然后自行編譯安裝。這種包一般都是經過了海量的測試后才發布的,而且非常接近最新beta或者alpha版本。 此外,你還可以snaps.php.net提供的快照包來下載php進行編譯安裝,這個站點每幾個小時便會從源碼庫里打包出一份新的PHP。不過從這取得的包可能會因為某個未經完整測試的代碼提交而使PHP工作不正常。但是如果你想研究下PHP6.0的進展,這里絕對是你方便獲取它的地方。 最后,你可以直接從版本庫中導出此時此刻的源碼。作為一個擴展開發者,從版本庫或者snaps中獲取php看起來并沒有多大的作用,但是如果我們要將這個擴展推送到版本庫中時,便需要熟練的掌握checkout和checkin的步驟了。簽出的地址在上面已經說過了。 ## links - 4 [動手編譯PHP](4.html) - 4.2 [PHP編譯前的config配置](4.2.html)
                  <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>

                              哎呀哎呀视频在线观看