extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;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
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=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.dll
extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
extension=php_tidy.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone 选择时区列表网址
date.timezone = Asia/Shanghai
[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
openssl.cafile= cacert.pem
根据需求可以自己添加扩展。
修改前:默认的是 Apache24 下的 htdocs 目录:
修改后:指定到自定义的路径,但是要记住这个路径。
修改前:
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
修改后:
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html index.php index.htm
</IfModule>
LoadModule rewrite_module modules/mod_rewrite.so4
如果是 PHP 5,在 httpd.conf 文件最后添加如下代码:
#php5.6
LoadModule php5_module C:/HttpWeb/php-5.6.33/php5apache2_4.dll
<IfModule php5_module>
PHPIniDir "C:/HttpWeb/php-5.6.33/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
如果是 PHP 7,则相应的更改,示例如下:
#php7
LoadModule php7_module C:/HttpWeb/php_7.1.33/php7apache2_4.dll
<IfModule php7_module>
PHPIniDir "D:/HttpWeb/php_7.1.33/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
<?php
echo phpinfo();
?>
最后说明一点儿,PHP 环境搭建可以借助于 PHP 开发环境搭建工具,下载地址:http://www.php.cn/xiazai/gongju或者http://www.wampserver.com/,在此处就不介绍工具安装方法了。