湖北省建设厅的网站,视频网站的嵌入代码是什么,wordpress 作品相册,深圳网站建设定制Mac升级到yosemite后#xff0c;php也自动升级#xff0c;运行项目的时候发现后台验证码显示不出来。调试一下发现imagetfftext这个函数不存在#xff0c;应该gd没有安装完全#xff0c;因为Mac上的php实现系统自带的#xff0c;只能通过重新安装php来解决【不能通过安装扩… Mac升级到yosemite后php也自动升级运行项目的时候发现后台验证码显示不出来。调试一下发现imagetfftext这个函数不存在应该gd没有安装完全因为Mac上的php实现系统自带的只能通过重新安装php来解决【不能通过安装扩展来处理】经过对比发现使用homebrew安装会方便点。。。 首先重新安装freetype,jpeg,libpng,gd #先删除之前的再安装新的没有安装过的则直接跳过即可
sudo brew rm freetype jpeg libpng gd zlibbrew install freetype jpeg libpng gd zlib 安装过程可能会报下面的错误 Error: You must brew link libpng before gd can be installed 解决办法 #注意添加overwrite否则可能会提示冲突
sudo brew link --overwrite libpng下来就是安装php了【这里安装会覆盖之前的php】 #这里我选择版本的是php5.6因为之前系统默认的是php5.5用高版本的覆盖放心点
sudo brew install homebrew/php/php56安装完成之后有如下提示 To enable PHP in Apache add the following to httpd.conf and restart Apache:LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.soThe php.ini file can be found in:/usr/local/etc/php/5.6/php.ini✩✩✩✩ PEAR ✩✩✩✩If PEAR complains about permissions, fix the default PEAR permissions and config:chmod -R ugw /usr/local/Cellar/php56/5.6.10/lib/phppear config-set php_ini /usr/local/etc/php/5.6/php.ini system✩✩✩✩ 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:$PATHPHP56 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 shells equivalent configuration file:export PATH$(brew --prefix homebrew/php/php56)/bin:$PATH✩✩✩✩ FPM ✩✩✩✩To launch php-fpm on startup:mkdir -p ~/Library/LaunchAgentscp /usr/local/opt/php56/homebrew.mxcl.php56.plist ~/Library/LaunchAgents/launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php56.plistThe control script is located at /usr/local/opt/php56/sbin/php56-fpmOS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:PATH/usr/local/sbin:$PATHYou may also need to edit the plist to use the correct UserName.Please note that the plist was called homebrew-php.josegonzalez.php56.plist in old versions
of this formula.To have launchd start homebrew/php/php56 at login:ln -sfv /usr/local/opt/php56/*.plist ~/Library/LaunchAgents
Then to load homebrew/php/php56 now:launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist上面关键的是就是libphp5.so这个文件其他的暂时可以忽略了。。。 最后就是修改apache的配置文件【httpd.conf】把原来的libphp5.so文件路径替换为上面的重启apache即可 sudo sudo vim /etc/apache2/httpd.conf#这里别忘记要替换一下libphp.so的文件路径哦sudo apachectl restart