2015-04-26 10:21:41 3907次浏览 1条回答 0 悬赏 5 金钱

mac 升级10.10 自带5.5的php 验证码不显示

最佳答案

  • sjjliqpl 发布于 2015-04-26 17:47 举报

    是因为osx 10.10自带的php5.5的gd扩展不支持png,验证码是png图片,所有就不支持了。
    解决方案:可通过brew安装php5.5即可
    以下是复制过来的,你也可以自己google

    Solution
    
    Use the Homebrew package manager to painlessly build and install a complete PHP and replace it in Apache's config. The whole process only takes about ten minutes if you follow the steps below.
     
    
    A quick (but complete) walk through
    
    (Note 1: I use Homebrew here, a package management system for OS X. If you are acquainted with MacPorts – another package manager – you can acchieve the same results with that system. It is also possible to use my Homebrew solution in parallel to an existing MacPorts installation on your machine.)
    (Note 2: If you want to read all the details about the installation process, have a look at theHomebrew basic installation  and the Homebrew PHP installation  information. But you really won't need that if you follow these steps.)
    
    Now let's go...
    
    First install Xcode from App Store . If you already have it, check App Store again, to make sure you've got the latest version!
    
    Now you need to install the Xcode Command Line Tools. To do so, open a Terminal and enter:
    
    
    xcode-select --install
    The next command will install the Homebrew package manager system:
    
    
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    The script explains what it will do and then pauses before it does it.
    
    The next command to enter is a kind of system status test:
    
    
    brew doctor
    This checks the basics of the Homebrew installation. 
    I got a warning "You have MacPorts or Fink installed: /opt/local/bin/port ..." which I ignored successfully. ;)
    
    Now setup the homebrew/dupes tap which has dependencies we need:
    
    
    brew tap homebrew/dupes
    Setup the homebrew/versions tap which also has dependencies we need:
    
    
    brew tap homebrew/versions
    Then run the following command:
    
    
    brew tap homebrew/homebrew-php
    Now you are ready to finally build PHP. For a list of available configuration options you may run one of these:
    
    
    brew options php55
    brew options php56
    But I was fine just using the defaults.
    To do so enter ONE of these two, depending on your needs:
    
    
    brew install php55
    brew install php56
    (This takes a while, please be patient!)
    
    If you get an error of type "Cannot find OpenSSL's " you have not installed the Xcode Command Line Tools as I told you in the beginning. ;) Go ahead, install them and re-run that last command.
    
    PHP is built now and the script will end with some details about how to use it:
    
    Open httpd.conf (should be located at /private/etc/apache2/httpd.conf) and enable PHP by adding the following line
    
    
    LoadModule php5_module    /usr/local/opt/php55/libexec/apache2/libphp5.so
    Don't forget to comment out any existing LoadModule php5_module... line that might be present from Yosemite's own PHP version!
    
    Restart Apache
    
    
    sudo apachectl restart
    Your new php.ini file can be found in: /usr/local/etc/php/5.5/php.ini
    
    Enjoy!
    
    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
qiuch87
副董事长

qiuch87 济南

注册时间:2013-05-24
最后登录:2024-11-04
在线时长:228小时16分
  • 粉丝32
  • 金钱43435
  • 威望0
  • 积分45715

热门问题