简体   繁体   English

php.ini文件无处可寻?

[英]php.ini file nowhere to be found?

I am aware that there are a lot of questions regarding this already, but I've looked through each of them and have found nothing. 我知道有很多关于这方面的问题,但是我已经查看了每个问题并且一无所获。

I am running php 7.0.6, and Apache2.4. 我正在运行php 7.0.6和Apache2.4。 I downloaded PHP from windows.php.net/download (I got the second one down, the x86 threadsafe one). 我从windows.php.net/download下载了PHP(我得到了第二个,x86线程安全的)。 After download I extracted it straight to the C:\\ drive under C:\\php . 下载后,我将其直接提取到C:\\php下的C:\\驱动器。

I am trying to install the Magento e-commerce platform but am required to install a few PHP extensions before I can proceed (namely curl, xsl, intl, mbstring, openssl and gd) 我正在尝试安装Magento电子商务平台,但我需要在继续之前安装一些PHP扩展(即curl,xsl,intl,mbstring,openssl和gd)

I had a read around and found that to enable them I have to remove the semicolon before them in the php.ini file, so I have navigated to C:\\php and looked for it, but can only find php.ini-development and php.ini-production , which having looked at another thread, neither is what I want. 我有一个阅读,并发现要启用它们我必须在php.ini文件中删除它们之前的分号,所以我导航到C:\\php并查找它,但只能找到php.ini-developmentphp.ini-production ,看过另一个帖子,也不是我想要的。

I also read that it is sometimes just a file called php, but cannot find that either in the C:\\php folder 我还读到它有时只是一个名为php的文件,但无法在C:\\php文件夹中找到它

I then performed a phpinfo(); 然后我执行了一个phpinfo(); command in a php file and ran it, getting this result: 在php文件中命令并运行它,得到这个结果:

Configuration File (php.ini) Path        C:\Windows
Loaded Configuration File                (none)
Scan this dir for additional .ini files  (none)
Additional .ini files parsed             (none)

I have then looked in the C:\\Windows folder to no avail, and I don't know how I am supposed to find the php.ini file so I can remove the semicolon and load the php extensions. 然后我看了C:\\Windows文件夹无济于事,我不知道我应该如何找到php.ini文件,所以我可以删除分号并加载php扩展。

Any help would be appreciated. 任何帮助,将不胜感激。

Where PHP is installed C:\\php there is a php.ini-development and php.ini-production . 安装C:\\php地方C:\\php有一个php.ini-developmentphp.ini-production You can copy or rename one of these to php.ini . 您可以将其中一个复制或重命名为php.ini These are templates and have all of the default settings that are needed. 这些是模板,具有所需的所有默认设置。 The main difference is that the development one will have error reporting turned on and the production one will not: 主要区别在于开发人员将启用错误报告,而生产者不会:

It should be loaded from either the PHP directory C:\\php or C:\\windows . 它应该从PHP目录C:\\phpC:\\windows加载。 I use the PHP directory as PHP I believe, will always look in the directory from which PHP is run: 我使用PHP目录作为PHP我相信,将始终查看运行PHP的目录:

copy c:\php\php.ini-development c:\php\php.ini

Or: 要么:

copy c:\php\php.ini-development c:\windows\php.ini

My system: 我的系统:

Configuration File (php.ini) Path       C:\Windows
Loaded Configuration File               C:\app\php\php.ini

If you are running Windows 10 with Bash shell, you can run 如果您使用Bash shell运行Windows 10,则可以运行

php -i | grep '\.ini'

That will show all configuration files loaded. 这将显示加载的所有配置文件。 People who work on Windows more often can likely identify the native way to do the equivalent operation natively. 更频繁地在Windows上工作的人可能会识别本机方式来本地执行等效操作。

Make sure when you're copying or renaming the php.ini file that it changes the file extension from .ini-developement (or .ini-production, depending on which one you use) to just .ini. 确保在复制或重命名php.ini文件时,它将文件扩展名从.ini-developement(或.ini-production,取决于您使用的文件扩展名)更改为.ini。 If you can't see the extensions on the files you can change that by clicking >view and selecting the file name extensions check box on the far right. 如果您无法在文件上看到扩展名,可以通过单击最右侧的>查看并选择文件扩展名复选框来更改该扩展名

Alternatively, you can look at the file type column where it should say configuration file if the file extension has changed to .ini. 或者,如果文件扩展名已更改为.ini,则可以查看文件类型列,其中应该说出配置文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM