入门级安装教程,环境搭建php
window32位+httpd-2.4.10-win32-VC11+php-5.6.31-Win32-VC11-x86html
下载对应的安装包,可自行百度。解压到非中文目录,最好不要带符号mysql
解压压缩文件后复制php.ini-production,更名为php.ini,用记事本打开(notepad++),sql
搜索extension_dir = "ext",去掉前面的;改成安装目录的路径,以下所示apache
; Directory in which the loadable extensions (modules) reside. ; http://php.net/extension-dir ; extension_dir = "./" ; On windows: extension_dir = "D:/php/ext" ; Directory where the temporary files should be placed. ; Defaults to the system default (see sys_get_temp_dir) ; sys_temp_dir = "/tmp"
接下路搜索以下去前面没有引号的地方,找到后,去掉引号windows
;extension=php_intl.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll extension=php_mbstring.dll ;extension=php_exif.dll ; Must be after mbstring as it depends on it extension=php_mysql.dll extension=php_mysqli.dll ;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
搜索找到data.timezone,改成date.timezone =PRCapp
这里主要是修改时间。不然php默认的时间与中国时间有时间差ide
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone =PRC
直接解压后,进入Apache24\conf\httpd.conf,找到ServerRoot,这里为apache的默认目录,以下spa
# # Do not add a slash at the end of the directory path. If you point # ServerRoot at a non-local disk, be sure to specify a local disk on the # Mutex directive, if file-based mutexes are used. If you wish to share the # same ServerRoot for multiple httpd daemons, you will need to change at # least PidFile. # ServerRoot "c:/Apache24"
找到后替换,将路径替换为本地apache目录。c:/Apache24所有替换为D:/Apache24.net
在httpd.conf中添加以下内容支持php
LoadModule php5_module "D:/php/php5apache2_4.dll" PHPIniDir "D:/php" AddType application/x-httpd-php .php .html .htm
而后在Apache24\htdocs目录下新建index.php文件,内容以下
<?php phpinfo(); ?>
保存后,退出。
注意:
运行Apache24\bin\httpd.exe,这里我电脑提示msvcp100.dll缺失,须要下载window插件,网址https://www.microsoft.com/en-us/download/details.aspx?id=30679
进行下载
上述完成后打开Apache24\bin\httpd.exe文件,会停留在一个窗口下,别关。访问http://localhost/index.php
访问到php版本信息,配置成功