Home  >  Article  >  Backend Development  >  PHP&MYSQL server configuration instructions_PHP tutorial

PHP&MYSQL server configuration instructions_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:08:34925browse


Apache 1.3.22 for Win32+PHP 4.0.6+Active Perl 5.006001+Zend Optimizer v1.1.0+mod_gzip 1.3.19.1a+MySQL 4.0.0 Alpha
Apache 1.X for win32 Although the performance is poor (and IIS It's too far behind, I hope 2. PHP-4 has the characteristics of fast execution and high performance efficiency. PERL provides perl-cgi support, Zend Optimizer accelerates PHP programs, mod_zip is used to compress web server output data, and MySql is the database. The following is based on win2k/xp. It is too troublesome to run these service software on win9x and cannot be run as a service.

1.
Download location of each software:
Apache: http://www.apache.org/dist/httpd/binaries/win32/
PHP: http://www. php.net/downloads.php (Download .zip version)
Active Perl: http://www.activestate.com/Products...l/download.plex (Download win32)
Zend Optimizer: http: //www.zend.com/store/getfreefi...pid=13&zbid=198
mod_gzip: http://www.remotecommunications.com/apache/mod_gzip/ (download .dll)
MySQL: http: //www.mysql.com/downloads/index.html
Other software:
phpMyAdmin: http://sourceforge.net/project/show...release_id=44593 (for database control operations)

2.
Installation path (the following is an example, you can install it casually, but it is best not to install it in a path with a long name)
Apache: d: apache
PHP: d: php
Perl: d:perl
MySQL: d:mysql
mod_gzip: Unzip in d:apachemodules
Zend Optimizer: Unzip in d:php
Website file placement: d:myweb
phpMyAdmin: Unzip in d:mywebphpmyadmin
Windows: d:windows

3. Configure mysql
After installation, winmysqladmin will automatically run and prompt for username and password. Enter username and password. Default In this case, it has been installed as NT Service. If you need to be more secure, then modify the default port on the my.ini Setup page of winmysqladmin under port=port, and modify the username and password below. After modification, click Save Modification on the left to save the settings, then right-click on the console form and select WinNT->Stop The Service->Start The Service, so that the new settings will take effect.

4. Configure php
Rename php.ini-dist to php.ini and open the modification.
Add
zend_optimizer.optimization_level=15 in the next line of [php]
zend_extension_ts="d:phpZendOptimizer.dll"
The path to zendoptimizer.dll must match

Then search extension_dir, add the full name of your windirsystem32 directory at the end, for example: extension_dir = d:windowssystem32 (the last one must not be omitted!)
Look for extension=php_exif.dll, extension=php_imap.dll, extension=php_ldap.dll, extension=php_zlib.dll, remove the previous semicolon comment
Look for mysql.default_port, add your mysql port after the equal sign, for example: mysql.default_port = 3306 (3306 is the default port of mysql)
Look mysql.default_host, add localhost after the equal sign, for example: mysql.default_host = localhost
Save
Copy php.ini php.exe to the windows directory, and copy php4ts.dll, dlls and extensions under the directory in php Copy all .dll files to windowssystem32 (do not overwrite existing files)

5. Configure Apache
Open the apacheconfhttpd.conf file, the following are the main settings
ServerType standalone

ServerRoot "d:/Apache"
# Apache installation directory

PidFile logs/httpd.pid
ScoreBoardFile logs/apache_runtime_status
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MaxRequestsPerChild 1024
ThreadsPerChild 50
SendBufferSize 65536
MaxClients 150
Listen 80
# Listen on port 80, default web server port
BindAd dress *
# is Any IP can use web server

LoadModule vhost_alias_module modules/mod_vhost_alias.so
AddModule mod_vhost_alias.c
# Remove the # in front of these two lines to enable virtual domain name support

Port 80
ServerAdmin me@localhost
ServerName localhost
# Port, administrator email, server domain name, modify according to actual conditions

DocumentRoot "d:/myweb/"
# web file Save the address, here is d:/myweb as an example

Options FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all

# Set access options for d:/myweb
ScriptAlias ​​/cgi-bin "e:/myweb/cgi"

AllowOverride None
Options None
Order allow,deny
Allow from all

# Set cgi-bin directory permissions

#!/perl/bin/perl
# This line configures the running environment of perl-cgi. Since Active Perl is installed in d:perl, the relative path is used directly here
# Note that the cgi and pl to be run The first line of the file must be the same as here, otherwise it will not run.It can also be written here as
# #!d:/perl/bin/perl
# In addition, the first # in this configuration does not mean a comment, so it cannot be omitted! !

Find DirectoryIndex index.html and add below
DirectoryIndex index.htm
DirectoryIndex default.htm
DirectoryIndex default.html
DirectoryIndex index.php
DirectoryIndex index.php3
DirectoryIndex index.cgi

Find AddType application/x-httpd-php
Change to AddType application/x-httpd-php .php .phtml .php3

Find AddHandler cgi -script
Modify to AddHandler cgi-script .cgi .pl

LoadModule php4_module d:/php/sapi/php4apache.dll
LoadModule gzip_module d:/apache/modules/ApacheModuleGzip.dll
# Load php4, gzip module

### The following are gzip module settings
mod_gzip_on Yes
mod_gzip_minimum_file_size 300
mod_gzip_maximum_file_size 0
mod_gzip_maximum_inmem_size 1 00000
mod_gzip_keep_workfiles No
mod_gzip_dechunk Yes
mod_gzip_can_negotiate Yes
mod_gzip_temp_dir d:/apache/temp
# There must be a temp directory under the apache directory, if not, create a new one
mod_gzip_item_include file .html$
mod_gzip_item_include file .htm$
mod_gzip_item_include file .shtml$
mod_gzip_item_include file .shtm$
mod_gzip_item_include file .pl$
mod_gzip_item_include file .cgi$
mod_gzip_item_include mime^text /.*
mod_gzip_item_include handler ^perl- script$
mod_gzip_item_include mime ^httpd/unix-directory$
mod_gzip_item_include handler ^server-status$
mod_gzip_item_include handler ^server-info$
mod_gzip_item_include mime ^application/x-httpd -php
mod_gzip_item_include file .php$
mod_gzip_item_include file .php3$
mod_gzip_item_include file .mht$
mod_gzip_item_exclude file .css$
mod_gzip_item_exclude file .js$
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude reqheader Content-Type:multipart/form-data
mod_gzip_item_exclude reqheader Content-Type:application/x-www-form-urlencoded

mod_gzip_item_exclude file attachment.php$
#The above is required for VBB Required
### End of mod_gzip sample config
LogFormat "%h %l %u %t "%r" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." mod_gzip_info
# Record gzip operation status
# The above are the places that need to be added or modified in httpd.conf. Others do not need to be modified

6. Configure phpmyadmin
Open the config.inc.php file and modify it
$cfgServers[1]['host'] = 'localhost'; //mysql address
$cfgServers[1]['port' ] = '3306'; //mysql port
$cfgServers[1]['user'] = 'username'; //mysql username
$cfgServers[1]['password'] = 'passwd' ; //mysql password
$cfgDefaultLang = 'zh'; //Configure phpmyadmin as a simplified Chinese interface

Since phpmyadmin is a mysql configuration, it needs to be placed in a directory that others cannot guess or This directory requires user permission verification

7. Test
If you follow the default d:mywebphpmyadmin, then use a browser to open the following address http://localhost/phpmyadmin/
If the test is successful, phpmyadmin will appear On the mysql management page, click Show PHP information, or go to http://localhost/phpmyadmin/phpinfo.php. This shows the configuration and operation of web php mysql...
As long as you configure No problem, then the above Apache 1.3.22 for Win32+PHP 4.0.6+Active Perl 5.006001+Zend Optimizer v1.1.0+mod_gzip 1.3.19.1a+MySQL 4.0.0 Alpha is configured

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314753.htmlTechArticleApache1.3.22forWin32+PHP4.0.6+ActivePerl5.006001+ZendOptimizerv1.1.0+mod_gzip1.3.19.1a+MySQL4 .0.0Alpha Apache1.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn