Home Backend Development PHP Tutorial PHP&MYSQL服务器配置说明_PHP

PHP&MYSQL服务器配置说明_PHP

Jun 01, 2016 pm 12:38 PM
d Revise server Table of contents illustrate Configuration


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虽然**能差(和IIS比起来差太远了,希望2.X for win32早点出),但是它的bug比较少,资源占用也少,而且它的模块式更方便功能的增加。PHP-4具有执行快速,**能效率高的特点,PERL提供了perl-cgi的支持,Zend Optimizer是加速php程序的,mod_zip用来压缩web server输出数据,MySql为数据库。以下是以win2k/xp作为蓝本,win9x运行这些服务软件太麻烦了,没办法作为service来运行。 

一、 
各软件下载地点: 
Apache: http://www.apache.org/dist/httpd/binaries/win32/ 
PHP: http://www.php.net/downloads.php (下载.zip版本) 
Active Perl: http://www.activestate.com/Products...l/download.plex (下载win32) 
Zend Optimizer: http://www.zend.com/store/getfreefi...pid=13&zbid=198 
mod_gzip: http://www.remotecommunications.com/apache/mod_gzip/ (下载.dll) 
MySQL: http://www.mysql.com/downloads/index.html 
其他软件: 
phpMyAdmin: http://sourceforge.net/project/show...elease_id=44593 (用于对数据库的控制操作) 

二、 
安装路径(以下是范例,可以随便安装,但是最好不要安装在带有长名字的路径) 
Apache :d:\apache 
PHP :d:\php 
Perl :d:\perl 
MySQL :d:\mysql 
mod_gzip :解压在d:\apache\modules 
Zend Optimizer :解压在d:\php 
网站文件放置 :d:\myweb 
phpMyAdmin :解压在d:\myweb\phpmyadmin 
Windows : d:\windows 

三、配置mysql 
安装后会自动运行winmysqladmin,并且提示输入用户名密码,输入用户名,密码,默认情况下已经安装为NT的Service,如果需要更安全点,那么在winmysqladmin 的my.ini Setup那一页 port=端口 那里修改默认的端口,在下面还有用户名密码的修改。修改完了,点击左边的Save Modiffication保存设置,然后右键点击控制台窗体,选WinNT->Stop The Service->Start The Service,这样新设置就生效了。 

四、配置php 
将php.ini-dist改名为php.ini,并且打开修改。 
在[php]的下一行添加 
zend_optimizer.optimization_level=15 
zend_extension_ts="d:\php\ZendOptimizer.dll" 
zendoptimizer.dll的路径一定要符合 

接着查找extension_dir,在后面=加上你的windir\system32\目录全称,例如:extension_dir = d:\windows\system32\ (最后的\一定不能省略!) 
查找extension=php_exif.dll、extension=php_imap.dll、extension=php_ldap.dll、extension=php_zlib.dll,将前面的分号注释去掉 
查找mysql.default_port,在等号后面添加你的 mysql 端口,例如:mysql.default_port = 3306 (3306是mysql的默认端口) 
查找mysql.default_host,在等号后面添加localhost,例如:mysql.default_host = localhost 
保存 
将php.ini php.exe复制到windows目录,将php里面php4ts.dll、dlls以及extensions目录下面的全部.dll文件复制到windows\system32下面(不要覆盖已有文件) 

五、配置Apache 
打开apache\conf\httpd.conf文件,以下为主要设置 
ServerType standalone 

ServerRoot "d:/Apache" 
# Apache安装的目录 

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 
# 监听80端口,默认web server端口 
BindAddress * 
# 在任何ip均可以使用web server 

LoadModule vhost_alias_module modules/mod_vhost_alias.so 
AddModule mod_vhost_alias.c 
# 去掉这两行前面的#,开启虚拟域名的支持 

Port 80 
ServerAdmin me@localhost 
ServerName localhost 
# 端口、管理员email,服务器域名,按实际修改 

DocumentRoot "d:/myweb/" 
# web文件保存地址,这里是以d:/myweb作为例子 
 
Options FollowSymLinks MultiViews 
AllowOverride all 
Order allow,deny 
Allow from all 
 
# 设置d:/myweb的访问选项 
ScriptAlias /cgi-bin "e:/myweb/cgi" 
 
AllowOverride None 
Options None 
Order allow,deny 
Allow from all 
 
# 设置cgi-bin目录权限 

#!/perl/bin/perl 
# 这一行配置perl-cgi的运行环境,由于Active Perl安装在d:\perl,所以这里直接使用相对路径 
# 注意,要运行的cgi、pl文件的头一行要和这里相同,否则不能运行。这里也可以写成 
# #!d:/perl/bin/perl 
# 另外这个配置第一个#不代表注释的意思,所以不能省略!! 

查找DirectoryIndex index.html,在下面添加 
DirectoryIndex index.htm 
DirectoryIndex default.htm 
DirectoryIndex default.html 
DirectoryIndex index.php 
DirectoryIndex index.php3 
DirectoryIndex index.cgi 

查找AddType application/x-httpd-php 
修改为AddType application/x-httpd-php .php .phtml .php3 

查找AddHandler cgi-script 
修改为AddHandler cgi-script .cgi .pl 

LoadModule php4_module d:/php/sapi/php4apache.dll 
LoadModule gzip_module d:/apache/modules/ApacheModuleGzip.dll 
# 加载php4,gzip模块 

### 以下为gzip模块设置 
mod_gzip_on Yes 
mod_gzip_minimum_file_size 300 
mod_gzip_maximum_file_size 0 
mod_gzip_maximum_inmem_size 100000 
mod_gzip_keep_workfiles No 
mod_gzip_dechunk Yes 
mod_gzip_can_negotiate Yes 
mod_gzip_temp_dir d:/apache/temp 
# 必须在apache目录下面有一个temp目录,没有就新建一个 
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$ 
#上面这个是VBB必须要的 
### 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 
# 记录gzip运行情况 
# 以上为httpd.conf需要添加或者修改的地方,其他不用修改可以了 

六、配置phpmyadmin 
打开config.inc.php文件修改 
$cfgServers[1]['host'] = 'localhost'; //mysql地址 
$cfgServers[1]['port'] = '3306'; //mysql端口 
$cfgServers[1]['user'] = 'username'; //mysql用户名 
$cfgServers[1]['password'] = 'passwd'; //mysql密码 
$cfgDefaultLang = 'zh'; //配置phpmyadmin为简体中文界面 

由于phpmyadmin这个是mysql配置,所以需要将他放在一个别人猜不到的目录或者该目录需要用户权限验证 

七、测试 
如果按照默认的d:\myweb\phpmyadmin,那么用浏览器打开以下地址http://localhost/phpmyadmin/ 
如果测试成功会出现phpmyadmin的mysql管理页面,点击Show PHP information ,或者去http://localhost/phpmyadmin/phpinfo.php,这个显示出web php mysql的配置情况以及运行情况......... 
只要配置没问题,那么上面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配置完毕 
Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to change the personal name in the group on DingTalk_How to modify the personal name in the group on DingTalk How to change the personal name in the group on DingTalk_How to modify the personal name in the group on DingTalk Mar 29, 2024 pm 08:41 PM

1. First open DingTalk. 2. Open the group chat and click the three dots in the upper right corner. 3. Find my nickname in this group. 4. Click to enter to modify and save.

Can Douyin Blue V change its name? What are the steps to change the name of corporate Douyin Blue V account? Can Douyin Blue V change its name? What are the steps to change the name of corporate Douyin Blue V account? Mar 22, 2024 pm 12:51 PM

Douyin Blue V certification is the official certification of a company or brand on the Douyin platform, which helps enhance brand image and credibility. With the adjustment of corporate development strategy or the update of brand image, the company may want to change the name of Douyin Blue V certification. So, can Douyin Blue V change its name? The answer is yes. This article will introduce in detail the steps to modify the name of the enterprise Douyin Blue V account. 1. Can Douyin Blue V change its name? You can change the name of Douyin Blue V account. According to Douyin’s official regulations, corporate Blue V certified accounts can apply to change their account names after meeting certain conditions. Generally speaking, enterprises need to provide relevant supporting materials, such as business licenses, organization code certificates, etc., to prove the legality and necessity of changing the name. 2. What are the steps to modify the name of corporate Douyin Blue V account?

How to configure Dnsmasq as a DHCP relay server How to configure Dnsmasq as a DHCP relay server Mar 21, 2024 am 08:50 AM

The role of a DHCP relay is to forward received DHCP packets to another DHCP server on the network, even if the two servers are on different subnets. By using a DHCP relay, you can deploy a centralized DHCP server in the network center and use it to dynamically assign IP addresses to all network subnets/VLANs. Dnsmasq is a commonly used DNS and DHCP protocol server that can be configured as a DHCP relay server to help manage dynamic host configurations in the network. In this article, we will show you how to configure dnsmasq as a DHCP relay server. Content Topics: Network Topology Configuring Static IP Addresses on a DHCP Relay D on a Centralized DHCP Server

Understand Linux Bashrc: functions, configuration and usage Understand Linux Bashrc: functions, configuration and usage Mar 20, 2024 pm 03:30 PM

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

Best Practice Guide for Building IP Proxy Servers with PHP Best Practice Guide for Building IP Proxy Servers with PHP Mar 11, 2024 am 08:36 AM

In network data transmission, IP proxy servers play an important role, helping users hide their real IP addresses, protect privacy, and improve access speeds. In this article, we will introduce the best practice guide on how to build an IP proxy server with PHP and provide specific code examples. What is an IP proxy server? An IP proxy server is an intermediate server located between the user and the target server. It acts as a transfer station between the user and the target server, forwarding the user's requests and responses. By using an IP proxy server

What should I do if I can't enter the game when the epic server is offline? Solution to why Epic cannot enter the game offline What should I do if I can't enter the game when the epic server is offline? Solution to why Epic cannot enter the game offline Mar 13, 2024 pm 04:40 PM

What should I do if I can’t enter the game when the epic server is offline? This problem must have been encountered by many friends. When this prompt appears, the genuine game cannot be started. This problem is usually caused by interference from the network and security software. So how should it be solved? The editor of this issue will explain I would like to share the solution with you, I hope today’s software tutorial can help you solve the problem. What to do if the epic server cannot enter the game when it is offline: 1. It may be interfered by security software. Close the game platform and security software and then restart. 2. The second is that the network fluctuates too much. Try restarting the router to see if it works. If the conditions are OK, you can try to use the 5g mobile network to operate. 3. Then there may be more

How to modify the address location of published products on Xianyu How to modify the address location of published products on Xianyu Mar 28, 2024 pm 03:36 PM

When publishing products on the Xianyu platform, users can customize the geographical location information of the product according to the actual situation, so that potential buyers can more accurately grasp the specific location of the product. Once the product is successfully put on the shelves, there is no need to worry if the seller's location changes. The Xianyu platform provides a flexible and convenient modification function. So when we want to modify the address of a published product, how do we modify it? This tutorial guide will provide you with a detailed step-by-step guide. I hope it can help. Everyone! How to modify the release product address in Xianyu? 1. Open Xianyu, click on what I published, select the product, and click Edit. 2. Click the positioning icon and select the address you want to set.

How to configure and install FTPS in Linux system How to configure and install FTPS in Linux system Mar 20, 2024 pm 02:03 PM

Title: How to configure and install FTPS in Linux system, specific code examples are required. In Linux system, FTPS is a secure file transfer protocol. Compared with FTP, FTPS encrypts the transmitted data through TLS/SSL protocol, which improves Security of data transmission. In this article, we will introduce how to configure and install FTPS in a Linux system and provide specific code examples. Step 1: Install vsftpd Open the terminal and enter the following command to install vsftpd: sudo

See all articles