⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install.txt

📁 php安装源码,请下载后按照说明文件安装及配置
💻 TXT
📖 第 1 页 / 共 5 页
字号:
       http://snaps.php.net/php5-latest.tar.gz or download binaries for
       Windows http://snaps.php.net/win32/php5-win32-latest.zip.
     * a prerelease version downloadable from http://qa.php.net/.
     * you have always the option to obtain PHP through anonymous CVS.

     These versions of PHP are compatible to Apache 2.0.40 and later.

     Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works with
     Apache 2.0.39, don't use any other version of Apache with PHP 4.2.3.
     However, the recommended setup is to use PHP 4.3.0 or later with the
     most recent version of Apache2.

     All mentioned versions of PHP will work still with Apache 1.3.x.

   Warning

   Apache 2.0.x is designed to run on Windows NT 4.0, Windows 2000 or
   Windows XP. At this time, support for Windows 9x is incomplete. Apache
   2.0.x is not expected to work on those platforms at this time.

   Download the most recent version of Apache 2.0.x and a fitting PHP
   version. Follow the Manual Installation Steps and come back to go on
   with the integration of PHP and Apache.

   There are two ways to set up PHP to work with Apache 2.0.x on Windows.
   One is to use the CGI binary the other is to use the Apache module DLL.
   In either case you need to edit your httpd.conf to configure Apache to
   work with PHP and then restart the server.

     Note: Remember that when adding path values in the Apache
     configuration files on Windows, all backslashes such as
     c:\directory\file.ext must be converted to forward slashes, as
     c:/directory/file.ext. A trailing slash may also be necessary for
     directories.
     __________________________________________________________________

Installing as a CGI binary

   You need to insert these three lines to your Apache httpd.conf
   configuration file to set up the CGI binary:

   Example 2-5. PHP and Apache 2.0 as CGI
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php

# For PHP 4
Action application/x-httpd-php "/php/php.exe"

# For PHP 5
Action application/x-httpd-php "/php/php-cgi.exe"

   Warning

   By using the CGI setup, your server is open to several possible
   attacks. Please read our CGI security section to learn how to defend
   yourself from those attacks.
     __________________________________________________________________

Installing as an Apache module

   You need to insert these two lines to your Apache httpd.conf
   configuration file to set up the PHP module for Apache 2.0:

   Example 2-6. PHP and Apache 2.0 as Module
# For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2.dll"
# Don't forget to copy the php4apache2.dll file from the sapi directory!
AddType application/x-httpd-php .php

# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

     Note: Remember to substitute your actual path to PHP for the c:/php/
     in the above examples. Take care to use either php4apache2.dll or
     php5apache2.dll in your LoadModule directive and not php4apache.dll
     or php5apache.dll as the latter ones are designed to run with Apache
     1.3.x.

     Note: If you want to use content negotiation, read related FAQ.

   Warning

   Don't mix up your installation with DLL files from different PHP
   versions. You have the only choice to use the DLL's and extensions that
   ship with your downloaded PHP version.
     __________________________________________________________________

Sun, iPlanet and Netscape servers on Microsoft Windows

   This section contains notes and hints specific to Sun Java System Web
   Server, Sun ONE Web Server, iPlanet and Netscape server installs of PHP
   on Windows.

   From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to
   generate custom directory listings and error pages. Additional
   functions for Apache compatibility are also available. For support in
   current web servers read the note about subrequests.
     __________________________________________________________________

CGI setup on Sun, iPlanet and Netscape servers

   To install PHP as a CGI handler, do the following:

     * Copy php4ts.dll to your systemroot (the directory where you
       installed Windows)
     * Make a file association from the command line. Type the following
       two lines:

assoc .php=PHPScript
ftype PHPScript=c:\php\php.exe %1 %*

     * In the Netscape Enterprise Administration Server create a dummy
       shellcgi directory and remove it just after (this step creates 5
       important lines in obj.conf and allow the web server to handle
       shellcgi scripts).
     * In the Netscape Enterprise Administration Server create a new mime
       type (Category: type, Content-Type: magnus-internal/shellcgi, File
       Suffix:php).
     * Do it for each web server instance you want PHP to run

   More details about setting up PHP as a CGI executable can be found
   here: http://benoit.noss.free.fr/php/install-php.html
     __________________________________________________________________

NSAPI setup on Sun, iPlanet and Netscape servers

   To install PHP with NSAPI, do the following:

     * Copy php4ts.dll to your systemroot (the directory where you
       installed Windows)
     * Make a file association from the command line. Type the following
       two lines:

assoc .php=PHPScript
ftype PHPScript=c:\php\php.exe %1 %*

     * In the Netscape Enterprise Administration Server create a new mime
       type (Category: type, Content-Type: magnus-internal/x-httpd-php,
       File Suffix: php).
     * Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6)
       and add the following: You should place the lines after mime types
       init.

Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="c:/
php/sapi/php4nsapi.dll"
Init fn="php4_init" LateInit="yes" errorString="Failed to initialise PHP!" [php_
ini="c:/path/to/php.ini"]

       (PHP >= 4.3.3) The php_ini parameter is optional but with it you
       can place your php.ini in your web server configuration directory.
     * Configure the default object in obj.conf (for virtual server
       classes [Sun Web Server 6.0+] in their vserver.obj.conf): In the
       <Object name="default"> section, place this line necessarily after
       all 'ObjectType' and before all 'AddLog' lines:

Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inike
y=value ...]

       (PHP >= 4.3.3) As additional parameters you can add some special
       php.ini-values, for example you can set a
       docroot="/path/to/docroot" specific to the context php4_execute is
       called. For boolean ini-keys please use 0/1 as value, not
       "On","Off",... (this will not work correctly), e.g.
       zlib.output_compression=1 instead of zlib.output_compression="On"
     * This is only needed if you want to configure a directory that only
       consists of PHP scripts (same like a cgi-bin directory):

<Object name="x-httpd-php">
ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
Service fn=php4_execute [inikey=value inikey=value ...]
</Object>

       After that you can configure a directory in the Administration
       server and assign it the style x-httpd-php. All files in it will
       get executed as PHP. This is nice to hide PHP usage by renaming
       files to .html.
     * Restart your web service and apply changes
     * Do it for each web server instance you want PHP to run

     Note: More details about setting up PHP as an NSAPI filter can be
     found here: http://benoit.noss.free.fr/php/install-php4.html

     Note: The stacksize that PHP uses depends on the configuration of
     the web server. If you get crashes with very large PHP scripts, it
     is recommended to raise it with the Admin Server (in the section
     "MAGNUS EDITOR").
     __________________________________________________________________

CGI environment and recommended modifications in php.ini

   Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE
   WS/iPlanet/Netscape is a multithreaded web server. Because of that all
   requests are running in the same process space (the space of the web
   server itself) and this space has only one environment. If you want to
   get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the correct
   way to try this in the old PHP 3.x way with getenv() or a similar way
   (register globals to environment, $_ENV). You would only get the
   environment of the running web server without any valid CGI variables!

     Note: Why are there (invalid) CGI variables in the environment?

     Answer: This is because you started the web server process from the
     admin server which runs the startup script of the web server, you
     wanted to start, as a CGI script (a CGI script inside of the admin
     server!). This is why the environment of the started web server has
     some CGI environment variables in it. You can test this by starting
     the web server not from the administration server. Use the command
     line as root user and start it manually - you will see there are no
     CGI-like environment variables.

   Simply change your scripts to get CGI variables in the correct way for
   PHP 4.x by using the superglobal $_SERVER. If you have older scripts
   which use $HTTP_HOST, etc., you should turn on register_globals in
   php.ini and change the variable order too (important: remove "E" from
   it, because you do not need the environment here):
variables_order = "GPCS"
register_globals = On
     __________________________________________________________________

Special use for error pages or self-made directory listings (PHP >= 4.3.3)

   You can use PHP to generate the error pages for "404 Not Found" or
   similar. Add the following line to the object in obj.conf for every
   error page you want to overwrite:
Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inik
ey=value...]

   where XXX is the HTTP error code. Please delete any other Error
   directives which could interfere with yours. If you want to place a
   page for all errors that could exist, leave the code parameter out.
   Your script can get the HTTP status code with $_SERVER['ERROR_TYPE'].

   Another possibility is to generate self-made directory listings. Just
   create a PHP script which displays a directory listing and replace the
   corresponding default Service line for type="magnus-internal/directory"
   in obj.conf with the following:
Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/scri
pt.php" [inikey=value inikey=value...]

   For both error and directory listing pages the original URI and
   translated URI are in the variables $_SERVER['PATH_INFO'] and
   $_SERVER['PATH_TRANSLATED'].
     __________________________________________________________________

Note about nsapi_virtual() and subrequests (PHP >= 4.3.3)

   The NSAPI module now supports the nsapi_virtual() function (alias:
   virtual()) to make subrequests on the web server and insert the result
   in the web page. The problem is, that this function uses some
   undocumented features from the NSAPI library.

   Under Unix this is not a problem, because the module automatically
   looks for the needed functions and uses them if available. If not,
   nsapi_virtual() is disabled.

   Under Windows limitations in the DLL handling need the use of a
   automatic detection of the most recent ns-httpdXX.dll file. This is
   tested for servers till version 6.1. If a newer version of the Sun
   server is used, the detection fails and nsapi_virtual() is disabled.

   If this is the case, try the following: Add the following parameter to
   php4_init in magnus.conf/obj.conf:
   Init fn=php4_init ... server_lib="ns-httpdXX.dll"

   where XX is the correct DLL version number. To get it, look in the
   server-root for the correct DLL name. The DLL with the biggest filesize
   is the right one.

   You can check the status by using the phpinfo() function.

     Note: But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!!
     __________________________________________________________________

OmniHTTPd Server

   This section contains notes and hints specific to OmniHTTPd on Windows.

     Note: You should read the manual installation steps first!

   Warning

   By using the CGI setup, your server is open to several possible
   attacks. Please read our CGI security section to learn how to defend
   yourself from those attacks.

   You need to complete the following steps to make PHP work with
   OmniHTTPd. This is a CGI executable setup. SAPI is supported by
   OmniHTTPd, but some tests have shown that it is not so stable to use
   PHP as an ISAPI module.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -