安装配置php

WBOY
WBOY원래의
2016-06-23 14:33:231070검색

 

1.到php官方网站下载php,我下载的文件名是php-5.4.3-Win32-VC9-x86.zip

解压到D盘的根目录,并改名为 d:\php 把 “d:\php”和“D:\php\ext”设置为环境变量

把 php.ini-development 拷贝一份并命名为 php.ini 并做如下修改:

doc_root ="D:/Program Files/CollabNet/Subversion Server/httpd/htdocs"

extension_dir = "D:/PHP/ext/"

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.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 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_pspell.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
;extension=php_zip.dll

 

做完配置之后在控制台用 php -v 和php -m来测试有无配置错误

 

2.配置apache,

在httpd.conf中添加如下行:

LoadModule php5_module "d:/php/php5apache2_2.dll"

phpinidir d:\php\php.ini
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm

并修改index内容如下:


    DirectoryIndex index.html index.php

重启apache,在主目录中放置测试页面  test.php

 


test

phpinfo();
?>

 

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
이전 기사:PHP 设置:timezone、error_log다음 기사:IBM的PHP专题