In short, the following steps are required
1, the installation of the package or ZIP package to install the PHP to the machine, the installation package can be omitted to configure the system environment variable "PATH" and configuration php.ini
, the disadvantage is that select several extension options installed to install several extension files, is not conducive to future system expansion, if the use of manual installation can be
Which extensions are opened by php.ini decision. At the same time can also have a deep understanding of the working mechanism of PHP.
2, install the Web service extension in IIS, if you only use PHP and static pages, only allow PHP extensions can be, all other disable. Online
Other articles say you must turn on ASP extensions, it is not necessary to turn on all unknown ISAPI extensions or open all unknown CGI extensions.
3, in your PHP Web site or virtual directory properties-"Home directory-" Map Bar-"Add application extensions, this step is in the address bar to understand
Don't. PHP extensions key.
4. In this step, IIS can actually parse PHP. You may execute a normal PHP script, but you may not be able to connect to the MySQL database.
About activating the MySQL extension library
In general, you can implement a page that displays Phpinfo (). Start with the problem that appears after you can display the page
Problems with PHP will be displayed on the phpinfo () page
First see if the path to your php.ini is correct
Q: I have configured the php.ini file, but why is there no effect after restarting the server?
A: There are several main problems with this problem.
The first reason is that the php.ini file read by the system is inconsistent with the php.ini file you modified at that time.
1, you can use the Phpinfo () configuration File (php.ini) path option to see what the current PHP server read php.ini
2, if you want to change the php.ini file access location, you can refer to the php.ini search order, as follows:
A the location specified by the SAPI module (phpinidir directive in Apache 2, the-C command-line option in CGI and CLI, Php_ini parameter in NSAPI, THTTPD environment variable in php_ini_path)
b) Hkey_local_machinesoftwarephpinifilepath (Windows registry location)
c) PHPRC Environment variables
d) Current working directory (for CLI)
e Web server directory (for SAPI modules) or PHP directory (other cases under Windows)
f) The Windows directory (c:windows or c:winnt), or the location specified by the--with-config-file-path compile-time option
3. General Practice: By setting PHPRC environment variables,
A) Action: Right-click My Computer-> Properties-> Advanced-> Environment variables
b Create an environment variable under the system variable named PHPRC, and the variable value is the file path of your php.ini file
The second reason is: PHP did not find the appropriate extension library
1, view the extension of PHP found in the location: Phpinfo () Extension_dir options can be seen
2. Change Extension_dir file in php.ini
Third reason: IIS is not fully restarted
1. Modifications to the php.ini must be completely restarted for IIS to work, not just for the current site to restart.
2, enter cmd, stop server: net stop iisadmin; Start server: net start w3svc
Q: How does my php have no way to activate the MySQL extension library
A: In PHP5.0 above, MySQL is not enabled by default, so we need to activate it manually.
1, in PHP run MySQL, must be activated in the php.ini php_mysql.dll Dynamic Connection Library, in addition to access to the MySQL Client connection library that Libmysql.dll file
2. The Php_mysql.dll Dynamic Connection Library can be activated via extension in php.ini, and Libmysql.dll file must be placed in the Windows system path to access. You can also add a path to the PATH environment variable by copying the Libmysql.dll to the System32 directory.