手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆

mac下面安装php5.4

首页 > 苹果相关 >

 苹果下面安装php5.4还算是比较方便的,主要是默认为php5.3,想用trait的时候,没5.4跑不了啊。。

于是直接使用brew install php54,结果报错,查了下资料,原来,需要:

  • brew tap josegonzalez/homebrew-php
  • brew tap homebrew/dupes 
  • brew install php54 --with-mysql --with-intl --with-fpm --without-apache 

因为有装nginx。所以就without-apache了。。。

安装好后,brew 会告诉你:

XML/HTML代码
  1. The php.ini file can be found in:  
  2.     /usr/local/etc/php/5.4/php.ini  
  3.   
  4. ✩✩✩✩ PEAR ✩✩✩✩  
  5.   
  6. If PEAR complains about permissions, 'fix' the default PEAR permissions and config:  
  7.     chmod -R ug+w /usr/local/Cellar/php54/5.4.13/lib/php  
  8.     pear config-set php_ini /usr/local/etc/php/5.4/php.ini  
  9.   
  10. ✩✩✩✩ Extensions ✩✩✩✩  
  11.   
  12. If you are having issues with custom extension compiling, ensure that this php is  
  13. in your PATH:  
  14.     PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"  
  15.   
  16. PHP54 Extensions will always be compiled against this PHP. Please install them  
  17. using --without-homebrew-php to enable compiling against system PHP.  
  18.   
  19. ✩✩✩✩✩ INTL Support ✩✩✩✩✩  
  20.   
  21. icu4c is broken as of mxcl/homebrew#03ed757c, so you will need to install intl as  
  22. a separate extension:  
  23.   
  24.     brew install php54-intl  
  25.   
  26. ✩✩✩✩ FPM ✩✩✩✩  
  27.   
  28. To launch php-fpm on startup:  
  29.     * If this is your first install:  
  30.         mkdir -p ~/Library/LaunchAgents  
  31.         cp /usr/local/Cellar/php54/5.4.13/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/  
  32.         launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist  
  33.   
  34.     * If this is an upgrade and you already have the homebrew-php.josegonzalez.php54.plist loaded:  
  35.         launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist  
  36.         cp /usr/local/Cellar/php54/5.4.13/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/  
  37.         launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist  
  38.   
  39. The control script is located at /usr/local/Cellar/php54/5.4.13/sbin/php54-fpm  
  40.   
  41. Mountain Lion comes with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /sbin is before /usr/sbin in your PATH:  
  42.   
  43.   PATH="/sbin:$PATH"  
  44.   
  45. You may also need to edit the plist to use the correct "UserName".  
  46.   
  47. Please note that the plist was called 'org.php-fpm.plist' in old versions  
  48. of this formula.  
  49.   
  50. To have launchd start php54 at login:  
  51.     ln -sfv /usr/local/opt/php54/*.plist ~/Library/LaunchAgents  
  52. Then to load php54 now:  
  53.     launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php54.plist  
  54. Warning: /usr/local/sbin is not in your PATH  
  55. You can amend this by altering your ~/.bashrc file  
记下这些路径和使用方法,以后会用得到




本站采用创作共享版权协议, 要求署名、非商业和保持一致. 本站欢迎任何非商业应用的转载, 但须注明出自"易栈网-膘叔", 保留原始链接, 此外还必须标注原文标题和链接.

Tags: mac, php

« 上一篇 | 下一篇 »

只显示10条记录相关文章

使用PHP得到所有的HTTP请求头 (浏览: 62788, 评论: 3)
我为什么会选用phpstorm (浏览: 52699, 评论: 5)
快速生成目录树 (浏览: 46847, 评论: 7)
通过file_get_contents来Post数据的实例 (浏览: 46410, 评论: 5)
PHP导入导出Excel方法 (浏览: 45235, 评论: 3)
PHP的XSS攻击过滤函数 (浏览: 42733, 评论: 2)
PHP中Eval的作用 (浏览: 41673, 评论: 4)
超详细:在Mac OS X中配置Apache + PHP + MySQL (浏览: 40396, 评论: 1)
PHP常见错误(二) (浏览: 39797, 评论: 1)
PHP sendmail (浏览: 37986, 评论: 7)

发表评论

评论内容 (必填):