Home php教程 php手册 php.ini-dist 和 php.ini-recommended 的区别介绍

php.ini-dist 和 php.ini-recommended 的区别介绍

Jun 06, 2016 pm 08:41 PM

在下载php后,进行配置的时候,会出现两个php.ini:php.ini-dist和php.ini-recommended,那有什么不同呢?应该如果选择适合自己的版本呢

php.ini-recommended的安全等级比php.ini-dist高。默认是把display_errors 设置为 off,将magic_quotes_gpc 设置为Off等等。而相对的php.ini-dist都是默认的配置。 所以说,如果你只是想进行web测试和普通开发,使用php.ini-dist,不然就是用php.ini-recommended。

具体参阅

简单说明:

如果是本地开发学习,建议复制 php.ini-dist一份保存为php.ini

如果是服务器上使用,为了安全,复制php.ini-recommended一份保存为php.ini

PhpIniDir的应用

PhpIniDir是PHP的初始化文件php.ini的路径,过去大家将php.ini放在windows目录下,在PHP5中,PHP.ini的查找路径不再限于PHP4时代的%SystemRoot%,PHP5会按以下顺序查找PHP.ini:

1、PHPIniDir(Apache 2 module only,这个指令仅仅用于当PHP作为Apache模块时使用,不支持CGI运行的PHP)
2、键值:HKEY_LOCAL_MACHINE/SOFTWARE/PHP/IniFilePath
3、环境变量:%PHPRC%
4、PHP5的目录(for CLI),或者web服务器目录(for SAPI modules)
5、Windows目录(C:/windows or C:/winnt)

这五个方案中,配合Apache2时最好使用PHPIniDir,即在apache2/conf/httpd.conf文件中加入:

# configure the path to php.ini
PHPIniDir " C:/php"

另外,NTFS上记得给服务器开PHP.ini的读权限。

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)