php.ini中的MAC OSX [英] php.ini Configuration on MAC OSX

查看:113
本文介绍了php.ini中的MAC OSX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了在Mac OSX上的PHP配置php.ini文件中一个奇怪的问题。我创建了一个文件的phpinfo。在浏览器中调用它显示了PHP设置与 -

I am experiencing a strange problem with PHP configurations file php.ini on mac osx. I have created a phpinfo file. Calling it in the browser shows the php settings with -

* *配置文件(php.ini中)路径:在/ etc

加载配置文件:/private/etc/php.ini **

不过在编辑​​php.ini文件在这个位置,(和重新启动当然Apache)的变化不会反映在PHP设置以及在的phpinfo文件。
例如:改变bcmath十进制数字,更改时区设置等是否有从那里Apache会拿起设置文件的另一个主要位置。任何帮助将是非常美联社preciated。

However upon editing the php.ini file at this location, (and restarting Apache of course) the changes are not reflected in the php settings as well as the phpinfo file. e.g.: changing the bcmath decimal digits, changing timezone settings etc. Is there another primary location from where Apache will pick up the settings file. Any help would be highly appreciated.

推荐答案

这是一个古老的职位,但我有这个问题,搜遍互联网无济于事,所以我在这里回答为后人。

This is an old post, but I had this problem and scoured the internet to no avail, so I answer here for posterity.

我使用的是原生的Mac OSX Apache2中自制自josegonzales 水龙头。

I'm using native Mac OSX apache2 with homebrew taps from josegonzales.

要引用我的系统的朋友,答案应该在于重新启动PHP-FPM,而不是Apache的。Apache使用的mod_fastcgi连接通过一个端口或插口,PHP-FPM运行PHP和到PHP。

To quote my sysadmin friend, "the answer should lie in restarting PHP-FPM instead of Apache. Apache uses mod_fastcgi to connect to PHP via a port or socket that PHP-FPM runs php with."

您需要加载/卸载你的PHP-FPM安装相关的plist文件。首先检查〜/库/ LaunchAgents不是吗?矿井位于:
     /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist

You need to load/unload the plist file associated with your PHP-FPM install. First check ~/Library/LaunchAgents Not there? Mine was located here: /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist

它的重新启动是这样的:
     launchctl卸载-w /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist&放大器;&安培; launchctl负载-w /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist;

It's restarted like this: launchctl unload -w /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist && launchctl load -w /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist;

我添加以下到我的〜/ .bash_profile中,这样,当我重新启动Apache我可以重新启动PHP-FPM。调用下面的命令是apachectlrestart

I added the following to my ~/.bash_profile so that I can restart PHP-FPM when I restart apache. The command to invoke the following is "apachectlrestart"

function apachectlrestart () { sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist && sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist && launchctl unload -w /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist && launchctl load -w /usr/local/Cellar/php53/5.3.26/homebrew-php.josegonzalez.php53.plist;}

这篇关于php.ini中的MAC OSX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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