我如何让Mac使用php.ini文件安装php? [英] How do I get Mac to install php with a php.ini file?

查看:185
本文介绍了我如何让Mac使用php.ini文件安装php?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mac High Sierra.我需要安装php.ini文件来安装php.我运行了以下命令,没有错误:

I'm using Mac High Sierra. I need to install php with the php.ini file installed. I ran the following command without errors:

brew install php71 --build-from-source

但是,当我搜索配置文件时,却什么也没得到:

However, when I search for a configuration file, I get nothing:

localhost:stratum-php-master davea$ php -i | grep "Loaded Configuration File"
Loaded Configuration File => (none)

如何让Mac识别php.ini文件?

How do I get Mac to recognize a php.ini file?

推荐答案

作为文档说,PHP将尝试在与SAPI模块相同的路径中查找配置文件.

As documentation says PHP will try to find config file in the same path with SAPI module.

所以我们应该找到PHP的位置:which php

So we should find where PHP is located: which php

然后将配置文件复制到cp php.ini /destination/path/

And then copy our config file there cp php.ini /destination/path/

这篇关于我如何让Mac使用php.ini文件安装php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆