php.ini是不存在的已加载配置文件(无)

问题描述:

我已经成功编译了php和apache,而没有指定php配置文件的目录.我想添加梨功能,但似乎在任何地方都没有php.ini.
在我的phpinfo中,它说

I have compiled php and apache successfully, without specifying the directory for the php config file. I want to add pear features, but there doesn't appear to be a php.ini anywhere.
In my phpinfo, it says

配置文件(php.ini)路径/usr/local/apache2/php/lib
加载的配置文件(无)
扫描此目录以查找其他.ini文件(无)
解析的其他.ini文件(无)

Configuration File (php.ini) Path /usr/local/apache2/php/lib
Loaded Configuration File (none)
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)

我去了/usr/local/apache2/php/lib目录,实际上什么也没有.我也搜索了php.ini,却没有任何结果.我需要更改php.ini中的内容,而且我不知道php如何在没有PHP的情况下工作.我只是想知道我是否需要使用配置目录重新编译php,以及如何查找/获取php.ini以便修复某些问题.

I went to the /usr/local/apache2/php/lib directory, and there was, indeed nothing there. I also searched for php.ini, and didn't get any results whatsoever. I need to change things in php.ini, and I don't know how php is even working without one. I am just wondering whether I need to recompile php with a config directory, and how to find/acquire a php.ini so that I can fix some things.

您必须从PHP源代码复制文件php.ini-dist.标准方法是将此类文件复制到/usr/local/lib/php.ini.

You have to copy the file php.ini-dist from PHP source. Standard way is copying such file to /usr/local/lib/php.ini.