apache + php + mysql php built environment

1. First prepare extracting package: the Zend-Loader-php5.6-Windows-x86_update1 (NTS version), php-5.6.37-nts- Win32-VC11-x86, mysql-5.5.19-win32;

2.PHP configuration:

(1) The php.ini.development rename the file saved to php.ini

Set time zone php.ini: date.timezone = Asia / Shanghai

(2) to edit your php.ini file, add a piece of code

[Zend.loader]

zend_loader.enable=1

zend_loader.disable_licensing=1

zend_loader.obfuscation_level_support=3

zend_loader.license_path=

zend_extension = "D: /webserver/php5.6.30/ext/ZendLoader.dll"

Front to "#" sign:

extension=php_gd2.dll

extension=php_mysql.dll

extension=php_mysqli.dll

extension=php_openssl.dll

extension=php_pdo_mysql.dll

extension=php_sqlite3.dll

extension_dir = “ext”

include_path = “.;E:/apm/php-5.6.37-nts-Win32-VC11-x86/includes”

Include conf / extra / httpd-vhosts.conf / * load httpd-vhosts.conf configuration file (specified URL to access the file path) * /

3.apache configuration:

以fcgid模式开启apache重要***
(1)修改apache的httpd.conf文件,加载添加mod_fcgid.so模块。
LoadModule fcgid_module modules/mod_fcgid.so
(2)添加httpd.conf的mod_fcgid的模块配置。(注意改路径)
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi .php
# Where to look for the php.ini file?
FcgidInitialEnv PHPRC “C:/Users/Administrator/Desktop/php+Apache+Mysql/php”
# Set PHP_FCGI_MAX_REQUESTS to greater than or equal to FcgidMaxRequestsPerProcess
# to prevent php-cgi process from exiting before all requests completed
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
# Maximum requests a process should handle before it is terminated
FcgidMaxRequestsPerProcess 1000
# Maximum number of PHP processes
FcgidMaxProcesses 15
Of Number The IDLE of seconds The # Time before IS A PHP-CGI Process terminated
FcgidIOTimeout 120
FcgidIdleTimeout 120
#Path to PHP-CGI
FcgidWrapper "C: /Users/Administrator/Desktop/php+Apache+Mysql/php/php-cgi.exe" .php
# for the Type-the Define the MIME the ".php" Files
the AddType file application / X-.php the httpd-PHP
</ IfModule>
(. 3) is modified httpd.conf added later Includes ExecCGI ==== Options Indexes FollowSymLinks >
Options Includes the Indexes FollowSymLinks ExecCGI
(4) restart apache, view your phpinfo () in the environment variable whether to join the fcgid

4. Add the patch file: the Zend-Loader-php5.6-Windows-x86, mod_fcgid-2.3.9-2.4.x-x64, which httpd-fcgid.conf file in C: / php path all changed their php path

5. Modify apache configuration file httpd.conf:

  • Path all changed their path;
  • Find ServerName localhost: 80 of the Notes to remove the port number to 8080 or do not change, you use the default port 80 (http default file transfer protocol port), write the address or local address 127.0.0.1 localhost

6. Modify apache configuration file httpd-vhosts.conf file (the default setting apache access file)

Note: Locate the httpd.conf file

Include conf / extra / httpd-vhosts.conf, the front of the # removed, which is the httpd-vhosts.conf file import, if not the introduction of access to the local project file will not jump to your specified

If the server does not introduce default index.html file access \ apache \ Apache24 \ htdocs under

Under httpd.conf file Code:

<IfModule dir_module>

DirectoryIndex index.html

</IfModule>

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot "C: / Users / Administrator / Desktop / php + Apache + Mysql / apache / Apache24 / htdocs / php2" (item path)

ServerName localhost (database server address: local address)

ServerAlias www.dummy-host.example.com

ErrorLog “logs/dummy-host.example.com-error.log”

CustomLog”logs/dummy-host.example.com-access.log” common

<Directory "C: / Users / Administrator / Desktop / php + Apache + Mysql / apache / Apache24 / htdocs / php2"> (path item)

Options Indexes FollowSymLinks Includes ExecCGI (parse php (nts) method, httpd.conf has this line command to copy and paste it over here will replace the original command)

AllowOverride None

Order allow,deny

Allow from all

DirectoryIndex index.html (the default access project files: index.html)

</Directory>

</VirtualHost>

7. Add the Apache as a system service (cmd add)

(1) Start -> Command which enter: cmd to open the familiar black DOS window and press Enter;

the bin (2) to the original switching apache installation directory path with the cd command

(3) we can add the apache service httpd by this command, the specific command:

        1.httpd -k install this command, the service name to be installed is Apache2.2, the configuration file using the conf \ httpd.conf

        2.httpd -k install -n "service name" If you want to specify a service name, use the command

        3.httpd -k install -n "service name" -f "D: \ conf \ custom.conf" If you want to specify a service name, and use a custom configuration file, use the command

    After the addition, you can start, shut down or restart apache :( restart apache can access the local file)

Usually start, shut down or restart apache service can use Apache comes with Apache Service Monitor tool Alternatively, you can use the net start Apache2.2 or net stop Apache2.2 and other console commands, of course, but also to the Windows Control Panel Services inside visualization, httpd there are corresponding solutions:

        1, httpd -k start # start apache service

        2, httpd -k stop or apache httpd -k shutdown # Stop Service

        3, httpd -k restart # restart the service apahce

    Correctness Before you start, you can "service name" -t configuration file is checked by httpd -n

If we want to add error, you can also delete the corresponding service name:

    Delete apache service httpd command or to adopt

        1, httpd -k uninstall # delete the default service name

        2, httpd -k uninstall -n "service name" # delete the specified file name

Of course, add, delete, or run the Apache Windows service that comes with Windows command mode can also be used.

PS: try to use a higher version of Apache, which many orders are written, you do not have to write.

Guess you like

Origin www.cnblogs.com/maxiaocang/p/11068015.html