Windows + Apache + PHP5 configuration method

xiaoxiao2021-03-06  30

1. Extract the PHP5 compression package to a folder C: / PHP.

2. Modify the environment variable of Windows PATH. The modification method is as follows:

(1) Right-click on the "My Computer" icon of the desktop, select "Properties" in the shortcut menu option that pops up.

(2) Select the Advanced tab in the pop-up dialog box, click the Environment Variable button.

(3) Find the PATH variable in "System Variable", then click the "Edit" button, or double-click the "Path" variable, in the pop-up dialogue, add "C: / PHP" to "Path" variable. Note that the variable is ";" separated when the variable is added.

3. Create and edit the initial configuration file for PHP php.ini, the method is as follows:

(1) Copy the C: /PHP/Php.ini- Recommended file to the C: / WinNT, change it to PHP.ini.

(2) Set extension_dir to "C: / PHP / EXT" (extension_dir = "c: / php / ext"), in order to expand the PHP function, remove the extension = php_mysql.dll ";" .

(3) Set DOC_ROOT to Apache's root directory, default path: c: / apache / htdoc.

(4) Configure the parameters of the session, change the register_gloable by OFF to the ON state, will session.save_path = c: / sesSTMP.

(5) In order to use the file upload function, the parameter UPLOAD_TMP_DIR = C: / UPLOADTMP is uploaded uploaded.

4. Because it is to run the PHP as an Apache module, you need to configure Apache. Modify Apache's configuration file http.conf, copy the following two rows to the end of the http.conf file.

LoadModule PHP5_MODULE "c: / php/php5apache2.dll"

AddType Application / X-httpd-php .php

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

New Post(0)