> php教程 > php手册 > 본문

mac下面安装php5.4

WBOY
풀어 주다: 2016-06-06 20:08:59
원래의
925명이 탐색했습니다.

苹果下面安装php5.4还算是比较方便的,主要是默认为php5.3,想用trait的时候,没5.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 会告诉你:

    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.13/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 this php is  
    in your PATH:  
        PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH"  
    PHP54 Extensions will always be compiled against this PHP. Please install them  
    using --without-homebrew-php to enable compiling against system PHP.  
    ????? INTL Support ?????  
    icu4c is broken as of mxcl/homebrew#03ed757c, so you will need to install intl as  
    a separate extension:  
        brew install php54-intl  
    ???? FPM ????  
    To launch php-fpm on startup:  
        * If this is your first install:  
            mkdir -p ~/Library/LaunchAgents  
            cp /usr/local/Cellar/php54/5.4.13/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/  
            launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist  
        * If this is an upgrade and you already have the homebrew-php.josegonzalez.php54.plist loaded:  
            launchctl unload -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist  
            cp /usr/local/Cellar/php54/5.4.13/homebrew-php.josegonzalez.php54.plist ~/Library/LaunchAgents/  
            launchctl load -w ~/Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist  
    The control script is located at /usr/local/Cellar/php54/5.4.13/sbin/php54-fpm  
    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:  
      PATH="/sbin:$PATH"  
    You may also need to edit the plist to use the correct "UserName".  
    Please note that the plist was called 'org.php-fpm.plist' in old versions  
    of this formula.  
    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  
    Warning: /usr/local/sbin is not in your PATH  
    You can amend this by altering your ~/.bashrc file  
로그인 후 복사
记下这些路径和使用方法,以后会用得到
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!