From d60bb1d0d28a74033401085298a81972d23f91e6 Mon Sep 17 00:00:00 2001 From: Friedhelm Betz Date: Fri, 24 Jan 2003 20:36:23 +0000 Subject: [PATCH] major rewrite of the build process on windows. - cygwin is optional - rewording and ues of entities for urls git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@113343 c90b9560-bf6c-de11-be94-00142212c4b1 --- chapters/install.windows.xml | 423 ++++++++++++++++++++--------------- 1 file changed, 248 insertions(+), 175 deletions(-) diff --git a/chapters/install.windows.xml b/chapters/install.windows.xml index 3c2027f708..a33e2843ee 100644 --- a/chapters/install.windows.xml +++ b/chapters/install.windows.xml @@ -1,5 +1,5 @@ - + Installation on Windows systems @@ -357,159 +357,207 @@ "Why is building on Windows so hard?" Two reasons come to mind: - - Windows does not (yet) enjoy a large community of developers - who are willing to freely share their source. As a direct - result, the necessary investment in infrastructure required - to support such development hasn't been made. By and large, - what is available has been made possible by the porting of - necessary utilities from Unix. Don't be surprised if some of - this heritage shows through from time to time. - - - Pretty much all of the instructions that follow are of the - "set and forget" variety. So sit back and try follow the - instructions below as faithfully as you can. - + + + Windows does not (yet) enjoy a large community of developers + who are willing to freely share their source. As a direct + result, the necessary investment in infrastructure required + to support such development hasn't been made. By and large, + what is available has been made possible by the porting of + necessary utilities from Unix. Don't be surprised if some of + this heritage shows through from time to time. + + + + + Pretty much all of the instructions that follow are of the + "set and forget" variety. So sit back and try follow the + instructions below as faithfully as you can. + + - - Preparations + + &reftitle.required; - Before you get started, you have a lot to download... + To compile and build PHP you need a Microsoft + Development Environment. Microsoft Visuaul C++ 6.0 is recommended. + To extract the downloaded files you need a extraction utilitiy + (e.g.: Winzip). If you don't already have an unzip utility, you + can get a free version from InfoZip. - - - For starters, get the Cygwin toolkit from the closest cygwin - mirror site. This will provide you most of the popular GNU - utilities used by the build process. - - - Download the rest of the build tools you will need from the PHP - site at http://www.php.net/extra/win32build.zip. - - - Get the source code for the DNS name resolver used by PHP - at http://www.php.net/extra/bindlib_w32.zip. This - is a replacement for the resolv.lib - library included in win32build.zip. - - - If you don't already have an unzip utility, you will - need one. A free version is available from InfoZip. - - If you plan to compile PHP as a static Apache - module you will also need the - Apache sources - of your version of Apache. - + + Before you get started, you have to download... + + + + + ..the win32 buildtools from the PHP site + at &url.win32.buildtools;. + + + + + ..the source code for the DNS name resolver used by PHP + from + &url.win32.dnsresolver;. This is a replacement for the + resolv.lib library included in + win32build.zip. + + + + + If you plan to compile PHP as a Apache + module you will also need the Apache + sources. + + - Finally, you are going to need the source to PHP 4 itself. - You can get the latest development version using anonymous CVS. If you get - a snapshot or a source tarball, you - not only will have to untar and ungzip it, but you will have to - convert the bare linefeeds to crlf's in the *.dsp - and *.dsw files before Microsoft Visual C++ - will have anything to do with them. + Finally, you are going to need the source to PHP 4 itself. You can get + the latest development version using + anonymous CVS, a + snapshot or the most recent released + source tarball. + + + + Putting it all together + + After downloading the required packages you have to extract them in a + proper place. + + + + Create a working directory where all files end up after extracting, e.g: + c:\work. + + + + + Create the directory win32build under your + working directory (c:\work) and unzip + win32build.zip into it. + + + + + Create the directory bindlib_w32 under your + working directory (c:\work) and unzip + bindlib_w32.zip into it. + + + + + Extract the downloaded PHP source code into your working directory + (c:\work). + + + + Following this steps your directory structure looks like this: + + + + + + Create the directories c:\usr\local\lib. Copy + bison.simple from c:\work\win32build\bin + to c:\usr\local\lib. + - Place the Zend and - TSRM directories inside the - php4 directory in order for the projects - to be found during the build process. + Cygwin users may omit the last + step. A properly installed Cygwin environment provides the mandatory + files bison.simple and + bison.exe. - - Putting it all together - - - Follow the instructions for installing the unzip utility of - your choosing. - - - - - Execute setup.exe and follow the installation - instructions. If you choose to install to a path other than - c:\cygnus, let the build process know by setting - the Cygwin environment variable. On Windows 95/98 setting - an environment variable can be done by placing a line in - your autoexec.bat. On Windows NT, go to My - Computer => Control Panel => System and select the - environment tab. - - - - - - Make a temporary directory for Cygwin to use, otherwise many - commands (particularly bison) will fail. On Windows 95/98, - mkdir C:\TMP. For Windows NT, - mkdir %SystemDrive%\tmp. - - + + + Configure MVC ++ + + The next step is to configure MVC ++ to prepare for compiling. + Launch Microsoft Visual C++, and from the menu select + Tools => Options. In the dialog, select the + directories tab. Sequentially change the dropdown + to Executables, Includes, and Library files. Your entries should look + like this: - - - Make a directory and unzip win32build.zip into it. - - - - Launch Microsoft Visual C++, and from the menu select - Tools => Options. In the dialog, select the - directories tab. Sequentially change the dropdown - to Executables, Includes, and Library files, - and ensure that cygwin\bin, - win32build\include, and - win32build\lib are in each list, - respectively. (To add an entry, select a blank line - at the end of the list and begin typing). Typical entries - will look like this: - - - - c:\cygnus\bin - - - c:\php-win32build\include - - - c:\php-win32build\lib - - - - Press OK, and exit out of Visual C++. - - - - - Make another directory and unzip bindlib_w32.zip - into it. Decide whether you want to have debug symbols available - (bindlib - Win32 Debug) or not (bindlib - Win32 Release). - Build the appropriate configuration: - - - - For GUI users, launch VC++, and then select File => Open - Workspace and select bindlib. Then select Build=>Set - Active Configuration and select the desired configuration. - Finally select Build=>Rebuild All. - - For command line users, make sure that you either have - the C++ environment variables registered, or have run - vcvars.bat, and then execute one of the - following: + Executable files: c:\work\win32build\bin, + Cygwin users: cygwin\bin + + + + + Include files: c:\work\win32build\include + + + + + Library files: c:\work\win32build\lib + + + + + + + + Build resolv.lib + + You must build the resolv.lib library. + Decide whether you want to have debug symbols available + (bindlib - Win32 Debug) or not (bindlib - Win32 Release). + Build the appropriate configuration: + + + + For GUI users, launch VC++, and then select File => Open + Workspace, navigate to c:\work\bindlib_w32and + select bindlib.dsw. Then select Build=>Set + Active Configuration and select the desired configuration. + Finally select Build=>Rebuild All. + + + + + For command line users, make sure that you either have the C++ + environment variables registered, or have run + vcvars.bat, and then execute one of the following + commands: @@ -524,63 +572,88 @@ - - At this point, you should have a usable - resolv.lib in either your - Debug or Release - subdirectories. Copy this file into your - win32build\lib directory over the - file by the same name found in there. - - - + At this point, you should have a usable resolv.lib + in either your c:\work\bindlib_w32\Debug or + Release subdirectories. Copy this file into your + c:\work\win32build\lib directory over the file + by the same name found in there. + Compiling - The best way to get started is to build the standalone/CGI version. + The best way to get started is to build the CGI version. - - For GUI users, launch VC++, and then select File => Open - Workspace and select php4ts. Then select Build=>Set Active - Configuration and select the desired configuration. Finally - select Build=>Rebuild All. - + + + For GUI users, launch VC++, and then select File => Open + Workspace and select c:\work\php-4.x.x\win32\php4ts.dsw + . Then select Build=>Set Active + Configuration and select the desired configuration, either + php4ts - Win32 Debug_TS or + php4ts - Win32 Release_TS. Finally select + Build=>Rebuild All. + + For command line users, make sure that you either have the C++ environment variables registered, or have run vcvars.bat, and then execute one of the - following: + following commands from the c:\work\php-4.x.x\win32 + directory: - - msdev php4ts.dsp /MAKE "php4ts - Win32 Debug_TS" - - - msdev php4ts.dsp /MAKE "php4ts - Win32 Release_TS" - - - At this point, you should have a usable - php.exe in either - your Debug_TS or - Release_TS subdirectories. - + + + msdev php4ts.dsp /MAKE "php4ts - Win32 Debug_TS" + + + + + msdev php4ts.dsp /MAKE "php4ts - Win32 Release_TS" + + + + + At this point, you should have a usable php.exe + in either your c:\work\php-4.x.x.\Debug_TS or + Release_TS subdirectories. + + - Repeat the above steps with php4isapi.dsp - (which can be found in sapi\isapi) in - order to build the code necessary for integrating PHP with - Microsoft IIS. + It is possible to do minor customization to the build process by editing + the main/config.win32.h.in file. For example you can + change the builtin extensions, the location of &php.ini; and - It is possible to do minor customization to the build process by editing - the main/config.win32.h.in file. + Next you may want to build the CLI version which is designed to use + PHP from the command line. + The steps are the same as for building the CGI version, except you have + to select the php4ts_cli - Win32 Debug_TS or + php4ts_cli - Win32 Release_TS project file. After a + succcessfull compiling run you will find the php.exe + in either the directory Release_TS\cli\ or + Debug_TS\cli\. + + + + If you want to use PEAR and the comfortable command line installer, + the CLI-SAPI is mandatory. For more information about PEAR and the + installer read the documantation at the + PEAR website. + + + + In order to build the SAPI module (php4isapi.dll + for integrating PHP with Microsoft IIS, set your active configuration to + php4isapi-whatever-config and build the desired dll.