How to install and configure php mysql in win7: first download php and extract the php compressed package to a directory; then add "PHP_HOME" to the PATH variable; then configure Apache and install mysql; finally restart httpd and Just test it.
Recommendation: "PHP Video Tutorial"
Description:
Author's The hardware environment is: Windows 7 64-bit
Select: VC15 x86 Thread Safe, the downloaded file name is: php-7.3.0-Win32-VC15 -x86.zip
For this installation, unzip it to: F:\ApatchInstallWorkspace\dev\servers\php Down.
Download address: https://www.apachelounge.com/download/ and select Apache 2.3.37 win32. (Needs to correspond to the version of php)
For this installation, extract it to the author's customized directory: F:\ApatchInstallWorkspace\dev\servers\httpd
##2.2 Configure Apache24/bin/httpd.conf File 2.3 Open the command line, cd to the Apache24\bin directory, run httpd.exeThe cursor stays at the bottom and flashes continuously At this time, the error message "AH00558: httpd.exe..." appears because ServerName is not configured. Open Apache24/conf/httpd.conf and configure "ServerName localhost:80" as shown below: After entering "httpd.exe" in the command line again, press Press Enter and there will be no error message. At this time, the cursor stops on the next line and flashes continuously, as shown below: Open the browser and enter in the navigation bar: http:// localhost/ , you will see the following page (proof that Apache is already running): Return to the command line, press ctrl c (there may be a delay) to stop apache2.4 Let apache be installed as a service under windowAs an administrator, run the command line and navigate to: Apache24\bin directory, as shown below:
Run: httpd.exe -k install Can be started or stopped in the "Services" of Windows apache service: Enter: service.msc in the command line, a pop-up box will appear containing: If duplicate services are added, You can use: sc delete service name to delete, as follows:
Right-click the apache cursor, you will see a pop-up box, click start in the pop-up box You can start the service. Click stop to close the service.
If the service is started, enter: http://localhost/ in the navigation bar of the browser, and it will See the content below, otherwise you will not be able to access the page.
The author has installed it before, the version is as follows:
In F:\ApatchInstallWorkspace\dev\servers\httpd\Apache24\ conf directory, open the httpd.conf file, move to the end of the file (or anywhere in the file), and write the following content:
LoadModule php7_module "F:/ApatchInstallWorkspace/dev/servers/php/php7apache2_4.dll" AddHandler application/x-httpd-php .php PHPIniDir F:/ApatchInstallWorkspace/dev/servers/php
The version of the component must match the version of apache (here, the Version is 2_4)
Find DirectoryIndex in the file and configure the following content:
Copy the php.ini-development file and copy it Name it: php.ini
Find and modify the following parameters:
##4.4 In php.ini, find the 'Dynamic Extensions' section and modify the following extension (open the comment and add the correct path):extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_curl.dll extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_gd2.dll extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_intl.dll extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_mbstring.dll extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_mysqli.dll extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_openssl.dll extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_soap.dll extension=F:/ApatchInstallWorkspace/dev/servers/php/ext/php_xmlrpc.dll
<?php phpinfo();
The above is the detailed content of How to install and configure php mysql in win7. For more information, please follow other related articles on the PHP Chinese website!