Mac下还有必要重新mac php安装目录PHP吗

Mac下还有必要重新安装PHP吗_百度知道
Mac下还有必要重新安装PHP吗
提问者采纳
这要看mac自带的php版本和你的需求,一般还是自己来安装下试试,自己安装的 知道配置文件等等的在哪,自己定制的更了解吧!
其他类似问题
为您推荐:
mac的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁mac下安装php gd库
升级到yosemite后,php也自动升级,运行phpcms时发现后台验证码显示不出来。很明显,缺少gd库,需要重新编译安装php,其过程十分辛苦,经过摸索发现使用brew安装比较方便。
首先安装freetype,jpeg,libpng,gd,zlib
brew rm freetype jpeg libpng gd zlib
brew install freetype jpeg libpng gd zlib
#先删除之前的再安装新的
然后创建链接
brew link --overwrite libpng freetype jpeg
#注意添加overwrite,否则可能会提示冲突
接着安装php
brew install php54
#我这里安装的5.4,你也可以安装其他版本
安装完成之后你应该会看到以下提示信息
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module
/usr/local/opt/php54/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.4/php.ini
???? PEAR ????
If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php54/5.4.33/lib/php
pear config-set php_ini /usr/local/etc/php/5.4/php.ini
???? Extensions ????
If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:
PATH="/usr/local/bin:$PATH"
PHP54 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.
???? PHP CLI ????
If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:
export PATH="$(brew --prefix homebrew/php/php54)/bin:$PATH"
To have launchd start php54 at login:
ln -sfv /usr/local/opt/php54/*.plist ~/Library/LaunchAgents
Then to load php54 now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php54.plist
虽然我英文不怎么好,但是大意还是看得明白。环境变量、设置开机启动什么的在此就不作说明了,我们需要做的是将原apache里的libphp5.so路径替换成/usr/local/opt/php54/libexec/apache2/libphp5.so
sudo vim /etc/apache2/httpd.conf
sudo apachectl restart
输出phpinfo(),gd库已安装成功,大功告成!Mac下还有必要重新安装PHP吗_百度知道
Mac下还有必要重新安装PHP吗
提问者采纳
看你需要了,mac默认安装了php,不过这个php是跟apache绑定在一起的,如果是使用apache可以不用安装了。但是使用nginx之类的服务器,就要重新装了!
其他类似问题
为您推荐:
mac的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 mac 安装php 的文章

 

随机推荐