PHP considers a comprehensive problem under the Windows system!

xiaoxiao2021-03-06  42

This section is suitable for Windows 98 / ME and Windows NT / 2000 / XP. PHP cannot run on a 16-bit platform such as Windows 3.1. Sometimes we call the PHP's Windows platform called Win32. Windows 95 is no longer supported from PHP 4.3.0.

There are two ways to install PHP for Windows: Manually install or use InstallShield installation.

If you have Microsoft Visual Studio, you can also compile the PHP source program.

Once the PHP is installed under the Windows system, you may need to load a variety of expansion libraries to implement more features.

Windows InstallShieldWindows version of the PHP installer can

http://www.php.net/downloads.php

Obtain, this program will install the PHP CGI version and automatically configure three web servers in IIS, PWS, and Xitami.

Note: Also note that although INSTALLSHIELD Installer is a simple way to run PHP, there are many restrictions, such as do not support automatic setting expansion libraries. Only downloading the ZIP compression package contains all supported extensions.

Install the HTTP server you choose and determine the normal work.

Run the executable installer and install it according to the prompt of the installation wizard. The installer supports two installation methods - standards, try to provide the best default parameters, advanced, question during installation.

The installation wizard collects sufficient information to configure the php.ini file and configure the web server to use PHP. In IIS and PWS under NT WorkStation, the script maps of all nodes on the server are listed, where you can select which additional script mapping of PHP is selected.

Once the installation ends, the installer prompts whether you need to restart the system. Start the server or start using PHP.

WARNING, this installed PHP is not safe. If you want to install PHP, it is best to manually, and carefully configure each option. Automated installations just provide a PHP that can be used immediately, and does not mean that can be used on a online server.

Handmade Steps This Installation Guide helps you manually install and configure PHP to your Windows Webserver. The original version of this guide is compiled by Bob Silva.

http://www.umesd.k12.or.us/php/win32install.html

You need to

http://www.php.net/downloads.php

Download a ZIP package that contains executable version.

The Windows version of PHP 4 has three ways - CGI executable program (PHP.exe), CLI executable (SAPI / PHP.exe) and other SAPI modules:

PHP4APache.dll - Apache 1.3.x Module PHP4APache2.dll - Apache 2.0.x Module PHP4isapi.dll - ISAPI module, such as IIS 4.0 / PWS 4.0 or Update version php4nsapi.dll - Netscape / iPlanet Module

The last one is a new way of PHP 4, providing significant performance growth and some new features. There is also a CLI version further explained in the chapter of the PHP command line mode.

WARNING SAPI modules have significant enhancements in version 4.1, however, in some old systems, you may encounter possible server errors or other modules such as ASP failures.

DCOM and MDAC Requirements: If you choose one of the SAPI modules and use it under Windows 95, you want to confirm that you download from Microsoft's DCOM page to install the DCOM update. If you use Windows 9x / NT4, you need to download the latest version of Microsoft Data Access Components (MDAC), located at http://www.microsoft.com/data/, no matter what web server, you need to make the following steps:

Release the PHP compression package into your selected directory. C: / is not bad. The compression package is released into a new directory similar to the PHP-4.3.1-Win32, which is best to be renamed PHP. In order to facilitate the convenience and version, the following steps assume that PHP is located in C: / PHP. You can choose other paths but preferably do not use the path in the middle (for example: C: / Program files / PHP), if so, some web servers will crash. The decompressed PHP directory structure looks like this:

C: / PHP | - CLI | || | -Php.exe - CLI executable - only for command line scripts || - DLLS - Supports DLLs for extended libraries -> Windows System Directory | || | | | | | -fdftk.dll | || | -... | - Extensions - PHP expansion library DLL | || | -php_bz2.dll | || | -php_cpdf. DLL | || | - .. | - MIBS - SNMP support file || - OpenSSL - OpenSSL support file || - PDF-Related - PDF support file || - SAPI - SAPI DLLS | || | | --PHP4Apache.dll | || | || | -php4isapi.dll | || | -.. || - .. || PHP.EXE - CGI executable || - .. || -php.ini-dist || -php.ini-recomment || -php4ts.dll - Main DLL -> Windows System Directory || -. .

CGI program - C: / php/Php.exe -, CLI program - C: /PHP/Cli/php.exe -, and SAPI modules - C: / PHP / SAPI / *. DLL - Depending on the main DLL C: / PHP / PHP4TS.DLL. It must be confirmed that this DLL can be found by PHP. Looking for this DLL is as follows:

Call the directory of php.exe. If you use the SAPI module, you call the DLL directory (for example, php4apache.dll) for the Webserver. Any directory in the Windows path environment variable PATH.

It is best to ensure that PHP4TS.DLL is available regardless of the interface (CGI or SAPI), so this file must be placed in the Windows path. The best position is the system directory of Windows:

C: / Windows / System for Windows 9X / ME C: / WINNT / SYSTEM32 for Windows NT / 2000 or C: / WinNT40 / System32 for Windows NT / 2000 Server Edition C: / Windows / System32 for Windows XP

If you plan to use the SAPI module in the C: / PHP / SAPI directory without copying the DLL file to the system directory of Windows, you can copy PHP4TS.DLL to the SAPI directory: C: / PHP / SAPI. The next step is to set a valid PHP profile, PHP.INI. Two INI files, php.ini-dist, and php.ini-recommended are included in the compressed package. It is recommended to use php.ini-recommented because this file performs performance and security optimization for default settings. Read the instructions in this document carefully and study the Ini settings to personally set up each item. If you want to achieve the best security, it is best to use this file, although PHP works well under the default Ini file. Copy the selected INI file to the directory that the PHP can find and rename it is php.ini. PHP searches for php.ini in a Windows directory:

Copy the selected INI file to% windir% under Windows 9X / ME / XP, usually C: / Windows. Copy the selected INI file to% WINDIR% or systemRoot by Windows NT / 2000, usually C: / WinNT or C: / Winnt40 corresponds to the server version.

If NTFS is used in Windows NT, 2000, or XP, make sure that the username of WebServer has read permissions to PHP.ini (for example, read it for Everyone).

The following steps are optional.

Edit the php.ini file. If you plan to use Omnihttpd, don't perform the next step. Point DOC_ROOT to WebServer's document_root. E.g:

Doc_root = c: / inetpub // for IIS / PWSDOC_ROOT = C: / Apache / HTDOCS / / FOR APACHE

The extension library that needs to be loaded when PHP is started. How to set up and those who have been built in the Windows extension. Note that after the new installation, it is recommended to determine that PHP is running normally when there is no extension and then adds any extended libraries in php.ini.

Under PWS and IIS, you can set BrowsCAP configuration to point to C: /Windows/system/inetsrv/browscap.ini (windows 9x / me) or c: /winnt/system32/inetsrv/browscap.ini (Windows NT / 2000) Or c: /windows/system32/inetsrv/browscap.ini (Windows XP).

Follow these instructions that set the basic steps of setting PHP under Windows. The next step is to select WebServer and run the PHP. There is a installation guide for the following WebServer:

.. Windows Server Series, Personal Web Server (PWS) 3, or Update; Internet Information Server (IIS) 3 and 4 or updated.

.. Apache server. Apache 1.3.x and apache 2.x.

.. Netscape / IPLANET server.

.. omnihttpd server.

.. Oreilly Website Pro Server.

.. Sambar server.

.. xitami server.

Before the compilation source program starts, it is worth answering this question: "Why is it so difficult to compile under Windows?":

There is no willing to share the developer group of the code for free under Windows. The direct result is that there is not enough investment to establish a system that supports this development method. In general, the available resources that do as possible are tools from UNIX. Don't surprise this tradition will appear from time to time. Almost all of the following descriptions are the type of "I will forget". So sit stability and do it as much as possible.

Need to compile PHP you need Microsoft development environment. It is recommended to use Microsoft Visuaul C 6.0. To release the downloaded files, you need a decompression tool (for example, WinZip). If you haven't decompressed tools, you can download one from Infozip.

Before you start, you need to download ...

PHP site

http://www.php.net/extra/win32build.zip

Win32 compilation tool.

Source code for the DNS parser used by PHP:

http://www.php.net/extra/bindlib_w32.zip

Use this to replace resolv.lib in Win32Build.zip.

If you plan to compile PHP to Apache, you also need Apache source.

Finally, you also need the source code of PHP 4. You can get the latest developments, a snapshot or the latest release of the source program by anonymous CVS.

After you download all the bags, you need to decompress them to the appropriate position.

Create a working directory as an unzipped place where all files are stored, for example: C: / Work.

Enter a directory Win32Build under your working directory (C: / Work) and extract Win32Build.zip to it.

Create a directory Bindlib_W32 under your working directory (C: / Work) and extract Bindlib_W32.zip to it.

Unpack the downloaded PHP source program into the working directory (C: / Work).

After these steps, your directory structure should be as follows:

- C: / Work | || - Bindlib_W32 | | || | - ARPA | | || | - Conf | | || | --... | || - PHP -4.xx | | || | - Build | | || | --... | | || | - Win32 | | || | --... | || - Win32build | | || | - bin | | || | - include | | || | - lib

Create a directory C: / usr / local / lib. Copy Bison.SIMPLE in C: / Work / Win32Build / BIN to C: / USR / Local / LIB.

Note: Cygwin users should ignore the last step. The Cygwin environment that is correctly installed has provided Bison.SIMPLE and BISON.EXE files.

Configuring MVC Next is to configure MVC to prepare compilation. Run Microsoft Visual C , select Tools => Options in the menu. In the dialog box, select the Directories tab. Change the drop-down box to Executables, Includes, and Library Files. Modify it to:

Executable Files: C: / Work / Win32Build / Bin, Cygwin User: CYGWIN / BIN

Include Files: C: / Work / Win32Build / Include

Library Files: C: / Work / Win32Build / Libbuild Resolv.lib must compile the resolv.lib library. I decide whether to debug information (Bindlib - Win32 Debug) still does not need (Bindlib - Win32 Release). Compile the appropriate configuration:

Graphical interface users, run VC , select File => Open Workspace, find the C: / Work / Bindlib_W32 directory and select Bindlib.dsw file. Menu and select Bindlib. Then select the build => Set Active Configuration menu and select the required configuration. Finally, build => Rebuild All.

Command line user, confirm that you either register the C environment variable, or run vcvars.bat, then run any of the following:

Msdev Bindlib.dsp / Make "Bindlib - Win32 Debug"

MSDEV Bindlib.dsp / Make "Bindlib - Win32 Release"

To this step, you should get a resolv.lib in your C: / WORK / BINDLIB_W32 / Debug or Release directory. Copy this file to the C: / WORK / WIN32BUILD / LIB directory and overwrite the files of the same name.

Compiling the best way to get starters is to compile the CGI version.

Graphical interface users, run VC , select File => Open Workspace menu and select C: /Work/php-4.x.x/win32/php4ts.dsw. Then select the build => set Active Configuration menu and select the desired configuration, either PHP4TS - Win32 Debug_ts or php4ts - Win32 Release_TS. Finally, build => Rebuild All.

Command line user, confirm that you either register the C environment variable, either run vcvars.bat, then run any of the following commands in 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"

To this step, you should get a available php.exe in your C: /Work/php-4.x.x./debug_ts or release_ts directory.

It is possible to make a small amount of customization by editing main / config.win32.h file. For example, you can modify the built-in extension library, or the location of the php.ini file.

The next step you might want to compile the CLI version, which is designed for a command line mode for PHP. Steps and Compile CGI versions are the same, except for PHP4TS_CLI - Win32 Debug_ts or PHP4TS_CLI - Win32 Release_TS project files. After successful compilation, you will find the php.exe file in the Release_TS / CLI / or DEBUG_TS / CLI / directory.

Note: If you want to use a PEAR or a comfortable command line installer, you have to use CLI-SAPI. See the PEAR website documentation for more information about PEAR and installer.

To compile SAPI modules (PHP4isapi.dll) to integrate PHP and Microsoft IIS, set the activated configuration to php4isapi-whatver-config and compile the required DLL. After installing PHP and WebServer installation, you may want to install some extended libraries to increase the function. You can choose which extension library is loaded when PHP starts by editing php.ini. You can also dynamically load with a DL () function in the program.

The beginning of the DLL file of the PHP 4 expansion library is 'php _' (PHP 3 is 'PHP3_'). This avoids confusion of PHP extensions and their support library.

Note: Support for BCMath, Calendar, COM, CTYPE, FTP, MYSQL, ODBC, OVERLOAD, PCRE, SESSION, Tokenizer, WDDX, XML, and ZLIB in PHP version 4.3.1 are built-in. These functions can be used without the need to load any extensions. You can see which modules can be built from the Readme.txt or Install.txt file in your own version or this form.

Edit the php.ini file:

You need to modify the extension_dir setting to point it to the directory where the extension is located, or place the directory of the PHP_ *. DLL file. Don't forget the last slash, for example:

EXTENSION_DIR = C: / PHP / EXTENSIONS /

The corresponding extension library is activated by canceling the annotations in the PHP.INI file in front of the EXTENSION = PHP _ *. Just delete the front; you can load the extended library corresponding to it. Example 3-3. Activation BZIP2 extension in PHP-Windows

// will be below:; extension = php_bz2.dll // change to extension = php_bz2.dll

Some expansion libraries require additional DLL files to work. Some of them can be found in the compressed packet, in the C: / PHP / DLLS / directory, but some, for example, the DLL required for Oracle (PHP_OCI8.DLL) is not bound in the compressed package. Copy the binding DLL from the C: / PHP / DLLS directory to the Windows path, for example:

C: / Windows / System for Windows 9X / ME C: / Winnt / System32 for Windows NT / 2000 C: / Windows / System32 for Windows XP

If these files are already installed in your system, they only cover them in the case of properly (before overwriting, it is best to back up, or move to other directories - to prevent misconduct).

转载请注明原文地址:https://www.9cbs.com/read-67292.html

New Post(0)