How to install php in win7? Detailed explanation of the installation and configuration of PHP under win7

小云云
Release: 2023-03-20 17:18:01
Original
4586 people have browsed it

This article mainly shares with you the detailed installation and configuration of PHP under win7. I hope it can help you.

How to install php in win7? Detailed explanation of the installation and configuration of PHP under win7

PHP installation

1), environment installation directory:

D:/wamp/   |——php
        |——php-5.6.22-Win32-VC11-x86
   |——Apache24
   |——mysql
   |——www
Copy after login

2), download

for linux: http://www.php.net/downloads.php
for windows: There are many versions of Windows on the official website http://windows.php.net/download/

. Which version to choose?

  • If your PHP application runs in FastCGI mode, please select the Non-Thread Safe (NTS) version;

  • If your PHP For applications running with Apache, please select the Thread Safe (TS) version.

This article uses the apache+php combination, so choose the ts (Thread Safe) version. Choose x64 or x86 depending on the operating system.

Most versions of PHP are compiled using VC9, VC11 or VC14 (compiled by Visual Studio 2008, 2012 or 2015 respectively), so you need to install the VC runtime environment on your computer.

The computer requires VC running environment:

  • VC9 x86: http://www.microsoft.com/en-us/download/details.aspx?id=5582

  • VC9 x64: http://www.microsoft.com/en-us/download/details.aspx?id=15336

  • VC11 x86 or x64: http://www.microsoft.com/en-us/download/details.aspx?id=30679

  • VC14 x86 or x64: http://www .microsoft.com/en-us/download/details.aspx?id=48145

3), installation and configuration

with php -5.6.22-Win32-VC11-x86.zip as an example.
After downloading, extract it to the D:\wamp\php\php-5.6.22-Win32-VC11-x86 directory.

Copy a copy of the php.ini-development file and rename it to php.ini.

Need to modify the following places:

Change the custom extension directory.
Find;extension_dir = "ext", change to

extension_dir = "D:\wamp\php\php-5.6.22-Win32-VC11-x86\ext"
Copy after login

Tips: When used with apache, the absolute position needs to be written. Otherwise the extension cannot be loaded.

Enable curl extension
Find again: ;extension=php_curl.dll, remove the semicolon: extension=php_curl.dll.

Remove some comments:

extension=php_bz2.dllextension=php_curl.dllextension=php_fileinfo.dllextension=php_gd2.dllextension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dllextension=php_mbstring.dllextension=php_exif.dll      ; Must be after mbstring as it depends on itextension=php_mysql.dllextension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Clientextension=php_openssl.dll
;extension=php_pdo_firebird.dllextension=php_pdo_mysql.dll
;extension=php_pdo_oci.dllextension=php_pdo_odbc.dllextension=php_pdo_pgsql.dllextension=php_pdo_sqlite.dllextension=php_pgsql.dll
;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed. 
; See http://www.php.net/manual/en/snmp.installation.php ;extension=php_snmp.dllextension=php_soap.dllextension=php_sockets.dllextension=php_sqlite3.dll
;extension=php_sybase_ct.dllextension=php_tidy.dllextension=php_xmlrpc.dllextension=php_xsl.dll
Copy after login

Set the default time zone

date.timezone=PRC
Copy after login

Set ssl (optional)

openssl.cafile= cacert.pem
Copy after login

Note that it is an absolute path.

Add custom extension

;[memcache]extension=php_memcache.dll
Copy after login
;[redis]extension=php_redis.dll
Copy after login

Note that you need to download the corresponding version of the extension:
For example, php_redis-2.2.7-5.6-ts-vc11-x86, pay attention to distinguish between ts/nts and x86/64.

Download address of some plug-ins

Related recommendations:

Installation and configuration of Apache+Mysql+PHP under Linux

The above is the detailed content of How to install php in win7? Detailed explanation of the installation and configuration of PHP under win7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!