IIS php environment configuration PHP5 MySQL5 ZendOptimizer phpmyadmin installation and configuration_PHP tutorial

WBOY
Release: 2016-07-21 15:49:10
Original
964 people have browsed it

This example is the installation and installation of
IIS5.1
php5.2.1(zip)
MySQL5.0.37
phpmyadmin2.10.0.2
ZendOptimizer-3.2.6
under wiondws XP Configuration
IIS installation

1 Put the WindowsXP SP2 system installation CD in the CD-ROM drive

2 Go to Control Panel> Add & Remove> Add/Remove Windows Components> Select Internet Information Services (IIS) in the Windows Component Wizard


3 Click Next to copy the files until the installation is completed


4 Complete the IIS installation


5 Open the browser and enter http://localhost. If the following interface appears, the installation is successful


MySQL installation

1 Click the MySQL installation package


2 The default is Typical, if you want to modify the installation path, you can also choose custom.
Note: In the path to install mysql, Cannot contain Chinese!


3 Click intall to start installation


4 Skip registration


5 Do you want to configure MySQL now? You can also configure it in the configuration wizard of the start menu later.
Here is the configuration now


6 Select Detailed Configuration and click Next to continue


7 The following option is to select the type of mysql application. The first is to develop the server , and the
will only use as little memory as possible. The second type is an ordinary WEB server, which will use a medium amount of memory.
The last one is a MySQL database that only runs on this server, which will occupy all the memory.
Users can choose options according to their own needs. Here are only Select the development server and click Next to continue


8 The following is to select the database purpose. The first one is multi-purpose.
will optimize the database into a good innodb (transaction) storage Type and high-efficiency myisam (non-transactional) storage type,
The second one is only used for transaction processing type, the best optimization innodb, but also supports myisam, only myisam supports full-text index
The last one The first is simple network development, suitable for simple applications. Only the myisam type that does not support transactions is supported.
Generally choose the first multi-functional one.


9 The following is to select the data storage location of InnodDB. It is generally the default and does not need to be changed
(If you want to modify the data saving path, you can also modify the datadir value of my.ini after installation)


10 The following is to select the maximum number of connections allowed by MySQL. The first is a maximum of 20 concurrent connections,
the second is a maximum of 500 concurrent connections, and the last is customized. You can customize it according to Choose according to your own needs.
Select the first one here


11 The following is whether to run the network link. Select the check box here. The port for database monitoring is generally 3306 by default.
If you change it to another port, you must remember the modified port when connecting to the database in the future, otherwise you will not be able to connect to the mysql database.
It is more troublesome. No modifications are made here. Use the default port of mysq: 3306


12 This step sets the default encoding of mysql. The default is latin1, which is also a standard encoding. The second is UTF8, and the third is manual setting.
encoding was introduced in version 4.1 or above. If To use data from the original database, it is best to determine what encoding the original database uses. If the encoding
set here is inconsistent with the encoding of the original database data, garbled characters may appear when using it. It is recommended to use latin1 standard encoding


Of course, if we need to, we can also modify its encoding (not recommended).


13 This step is whether to set mysql to For Windows services, generally choose to set it to a service,
so that you can start and close the MySQL database through the service in the future. Recommendation: also check the following check box,
In this way, in cmd mode, no need Do not go to the bin directory of mysql to execute the command. Consult the executable file on the command line


14 This step is to set the super user password of mysql. This super user is very important,
To have full permissions on mysql, please set it up and remember the super user password.
There is a check box below to create an anonymous account, which will make the database system unsafe.
If you have this requirement, you can also Please check.


15 Click Execute to install


16 Click Finish to complete the installation


17 We can start using mysql, open the mysql Command of all programs in the start menu line Client, enter the password
When this interface appears, it means that mysql has been installed


Possible problems:

If in the 15th Step, the following prompt appears

because you have installed mysql before. Some configuration files were retained when uninstalling.

Click retry to see if it can pass. Otherwise, click cancel to exit. Then click the MySQL Server Instance Config Wizard
in the start menu to reconfigure mysql

and repeat the previous operation. In step 14, the interface will appear as follows

There are three places to enter the password. You have installed mysql before.
You can enter the original root password in the first text box, and enter the new root password in the next two text boxes.

If it still doesn't work, reinstall MySQL.
Note on reinstallation: It is best to delete all the original files. If necessary, you can clear the registry.
If there are no other mysql-related programs on your machine. And be sure not to keep the original my.ini file.
The other thing is to delete the files in the original installation path and delete the ibdata1 file under the data directory.

More articles on PHP fan sitehttp://www.phpfans.net

Installation of PHP

Since php is a zip file (non-install version), the installation is relatively complicated Simply
decompress it. Rename the decompressed php-5.2.1-Win32 to php5 and copy it to the C drive directory. That is, the installation path is c:php5

1 Find php in the php directory .ini.recommended (or php.ini-dist) file, rename it to php.ini
and copy it to the windows directory of the system disk (take c:windows as an example).

2 Then Copy php5ts.dll and libmysql.dll in the php directory to the directory c:windowssystem32.

3 Copy the php_gd2.dll, php_mysql.dll and php_mbstring.dll files in the php5ext directory to c:windowssystem32
If php_gd2.dll is not loaded, php will not be able to process images. If php_mysql.dll is not loaded, php will not support the mysql function library
php_mbstring.dll supports wide characters when using phpmyadmin later
More articles on PHP enthusiast site http://www.phpfans.net

Installation of Zend Optimizer

Zend Optimizer Use code optimization methods to improve the execution speed of PHP applications. PHP programs that use Zend Optimizer execute 40% to 100% faster than those without. And some files encrypted with Zend SafeGuard must be installed with Zend Optimizer before they can run.
Note: Whether Zend Optimizer is installed or not does not affect the normal operation of php. If you find it troublesome, this step Can be omitted.

1 点击安装Zend Optimizer


2 接受协议,点击next


3 选定安装路径


4 我们用的是IIS5.1,所以这里选 IIS


5 选定 php.ini 的位置.我们的是在 C:\WINDOWS\ 下


6 选定IIS默认安装路径.我们的是 C:\Inetpub\


7 点击 Install 进行安装


8 点击 是.安装程序自动完成配置和服务器重启.


9 点击 Finish 完成安装


所有东西安装完成后我们再进行配置

配置php并关联MySQL
打开c:\windows\php.ini文件

以下内容需要回复才能看到

1 Set the extension path
Look for extension_dir and there is such a line
extension_dir = "./"
Change this line to
extension_dir = "C:php5ext"
where C:php5 is The path where you installed php. If the path is incorrect, the dll will not be loaded
(Note: some php versions are; extension_dir = "./" and the preceding semicolon must be removed)
2 Find
;extension=php_mbstring .dll
;extension=php_gd2.dll
;extension=php_mysql.dl
Remove the semicolon in front of the above three items, so that these dlls can be loaded when IIS starts
Of course we also did it earlier Copy these dlls to system32. (Everyone noticed how to load some dlls during the installation process.
You will need to load some dlls in the future, such as php_mysqli.dll, so you will know how to load them)
3 Set the session save path
Look for session.save_path and there is such a line
; session.save_path = "N;/path"
Add a line after this line (Please note that it is a line, Instead of adding it to the end)
session.save_path = "C:WINDOWSTemp"
Save it to your temporary directory. You can save it to the windows temporary directory Temp
4 There is something worth noting The one is short_open_tag. Some PHP versions are Off by default.
That is to say, PHP cannot use short tags such as must use
because short tags are easy to use, and many programs are also written with short tags, such as discuz, etc.
If you do not change short_open_tag to On, it will be difficult to determine whether the symptoms are due to the above reasons. It is recommended to modify
to find
short_open_tag = Off
and change it to
short_open_tag = On
5 Whether to display errors display_errors
For security reasons, some versions of display_errors also default to Off.
That is to say, during debugging, if there is an error in the PHP code, only a blank page will appear. The reason for the error and the error will not be displayed. The number of error lines.
This will be very inconvenient to debug. It is recommended to modify
to find
display_errors = Off (note not; - display_errors = Off [Security]) according to your own needs. Change
to
display_errors = On

6 Display NOTICE warning prompt
Although the error prompt is turned on in the fifth step, the error report is also controlled by error_reporting.
php5 turns off NOTICE warning prompt by default. If it is debugging locally, It is recommended to turn on the NOTICE warning prompt.
Search for
error_reporting = E_ALL & ~E_NOTICE
and change it to
error_reporting = E_ALL
Also, as a reminder, the error report output can also be controlled through error_reporting() in the program , please refer to the manual for how to use it.
7 register_globals
For security reasons, it is also Off by default
When register_globals=Off, the next program should use $_POST['user_name' when receiving ] and $_POST['user_pass'])
When register_globals=On, the next program can directly use $user_name and $user_pass to accept the value.
For more detailed instructions, please refer to
http://www.phpfans.net/bbs/archiver/?tid-234.htm
It is recommended to modify it according to your own needs
8 php5 time difference problem
The time difference is eight hours
Why? ?The PHP5 series version has added a new time zone setting. The default is Greenwich Mean Time, which is exactly 8 hours different from the East 8th District of China.
Look for date.timezone and there is such a line
; date.timezone =
Remove; and change it to
date.timezone = PRC
where PRC: People's Republic of China,
For more detailed solutions, please refer to this forum's
http:// www.phpfans.net/bbs/archiver/?tid-60.html
Please refer to the configuration of this forum
http://www.phpfans.net/ bbs/viewthread.php?tid=1663&extra=page%3D1
More articles php fan sitehttp://www.phpfans.net

IIS integrates PHP

1 打开 控制面板 > 管理工具


2 打开管理工具中的 Internet信息服务


3 如下图,右键默认网站 点击 属性


4 点击 ISAPI筛选器 再点击 添加 按钮,在弹出的 筛选器属性 对话框中,依次填入
筛选器名称: php
可执行文件: 点击浏览 选中 C:\php5\php5isapi.dll


5 点击 确定 退出配置


6 再次 右键默认网站 点击 属性.进入 ISAPI筛选器.如图,前面状态有个绿色的向上箭头,表示筛选已经起作用.
如果是向下的红色箭头或者没有箭头的话,那表明前面的配置有问题,请确认做了第5步.再不行请重新检查设置.


7 点击 主目录 标签.再点击 配置.


8 如下图,点击 添加 按钮


9 在弹出的 添加/编辑应用程序扩展名映射 对话框中.
可执行文件:点击浏览 选中 C:\php5\php5isapi.dll
可扩展名: .php (别漏了前面的 . )






10 点击 文档 标签,再点 添加 按钮,在弹出的 添加默认文档 对话框中,填入 index.php


配置完成后我们做一下测试
在网站根目录下创建一个 phpinfo.php 文件

phpinfo();
?>

在浏览器打开
http://localhost/phpinfo.php
如果出现如下信息,则说明php已经配置好了


下面再测试php和mysql数据库的关联
在网站根目录下创建一个test.php 文件,内容为

CODE:
<span style="COLOR: #000000"><span style="COLOR: #0000bb"></span><span style="COLOR: #007700"><?</SPAN><SPAN style="COLOR: #0000bb">php<BR></SPAN><SPAN style="COLOR: #0000bb">$host </SPAN><SPAN style="COLOR: #007700">= </SPAN><SPAN style="COLOR: #dd0000">"localhost"</SPAN><SPAN style="COLOR: #007700">;<BR></SPAN><SPAN style="COLOR: #0000bb">$user </SPAN><SPAN style="COLOR: #007700">= </SPAN><SPAN style="COLOR: #dd0000">"root"</SPAN><SPAN style="COLOR: #007700">;<BR></SPAN><SPAN style="COLOR: #0000bb">$password </SPAN><SPAN style="COLOR: #007700">= </SPAN><SPAN style="COLOR: #dd0000">"12345"</SPAN><SPAN style="COLOR: #007700">;</SPAN><SPAN style="COLOR: #ff8000">//12345改成你的mysql密码<BR></SPAN><SPAN style="COLOR: #0000bb">$link</SPAN><SPAN style="COLOR: #007700">=</SPAN><SPAN style="COLOR: #0000bb">mysql_connect</SPAN><SPAN style="COLOR: #007700">(</SPAN><SPAN style="COLOR: #0000bb">$host</SPAN><SPAN style="COLOR: #007700">,</SPAN><SPAN style="COLOR: #0000bb">$user</SPAN><SPAN style="COLOR: #007700">,</SPAN><SPAN style="COLOR: #0000bb">$password</SPAN><SPAN style="COLOR: #007700">); <BR>if(!</SPAN><SPAN style="COLOR: #0000bb">$link</SPAN><SPAN style="COLOR: #007700">) echo </SPAN><SPAN style="COLOR: #dd0000">"<h1>失败!</h1>"</span><span style="COLOR: #007700">;<br>else echo </span><span style="COLOR: #dd0000">"<h1>成功!</h1>"</span><span style="COLOR: #007700">;<br></span><span style="COLOR: #0000bb">mysql_close</span><span style="COLOR: #007700">();<br>?> </span><br></span>

Open http://localhost/test.php in the browser
If the output is successful, it means you are done.

More articles php Fan site http://www.phpfans.net

Install phpMyAdmin

Download phpMyAdmin-2.10.0.2-all-languages.zip, unzip it to the root directory of your website and rename it to phpMyAdmin.
Find and open libraries/config.default.php (some versions are config in the current directory. inc.php or config.defaut.php)
Make the following modifications:

1 Find the following two lines for password
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
Fill in your mysql password into $cfg['Servers'][$i][' password'] = ''; inside the single quotes

2 Search $cfg['PmaAbsoluteUri'], and set the value in the single quotes behind it to the phpMyAdmin directory path, such as: http://localhost /phpMyAdmin/ ;

3 Search $cfg['DefaultLang'] and set the value in single quotes after it to zh-gb2312;

The following is based on your needs Coding modification (if you are not very familiar with database coding, it is recommended not to modify it)
4 Search $cfg['DefaultCharset'] and set it to the encoding you want.

Open the browser and enter: http://localhost/phpMyAdmin/, IIS and MySQL have been started,
If the following page appears, the phpmyadmin installation is complete and can be used


phpMyAdmin Please take your time to familiarize yourself with the specific functions and will not go into details here.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319568.htmlTechArticleThis example is IIS5.1 php5.2.1(zip) MySQL5.0.37 phpmyadmin2.10.0.2 under wiondws XP Installation and configuration of ZendOptimizer-3.2.6 Installation of IIS 1 Put the WindowsXP SP2 system installation CD in the CD-ROM drive...
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template