Home  >  Article  >  Backend Development  >  深入PHP运行环境配置的详解_php实例

深入PHP运行环境配置的详解_php实例

WBOY
WBOYOriginal
2016-06-07 17:24:01754browse

运行环境配置:php54+Apache2.2+Mysql

1.默认端口设置:

#Listen 12.34.56.78:80

Listen 8080

2.加载模型:

LoadModule php5_module "D:\MyZILIAO\PHP\php54\php5apache2_2.dll"

3.支持的类型:

    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    PHPIniDir "D:\MyZILIAO\PHP\php54\"

4.Mysql的配置:

修改php.ini文件,配置php

首先将php目录中的php.ini-development或php.ini-production 复制到C:\WINDOWS目录中.并将其改名为php.ini 

php.ini-development 适合开发程式使用(测试用)

php.ini-production 拥有较高的安全性设定,则适合上线当产品使用

打开php.ini修改以下内容

找到; extension_dir = "./"这行,修改为extension_dir = " D:\php\ext" (注意去掉前面的";")

;date.timezone = 修改为 date.timezone ="asia/shanghai" (注意去掉前面的";")

short_open_tag 设置为 On

extension=php_mbstring.dll(宽字符支持,推荐选中 去掉前面的";")

extension=php_gd2.dll(PHP的GD库支持,必选 去掉前面的";")

extension=php_mysqli.dll (去掉前面的";")

extension=php_mysql.dll(使PHP支持MySQL,必选 去掉前面的";")

保存退出

Statement:
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