donglun1020
2016-04-29 08:33
浏览 85
已采纳

使用PHP和PDO进行Laravel和Brew安装

I have just moved from linux to mac and am having some issues installing PHP with the right drivers for Laravel.

I ran brew install homebrew/php/php56-mysqlnd_ms

but now I keep getting this error

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/opt/php56-mcrypt/mcrypt.so' - dlopen(/usr/local/opt/php56-mcrypt/mcrypt.so, 9): image not found in Unknown on line 0
phpinfo()

PHP Version => 5.6.21

Does anybody know how to fix this error? I am at a loss

图片转代码服务由CSDN问答提供 功能建议

我刚刚从linux迁移到mac,并且在使用Laravel的正确驱动程序安装PHP时遇到了一些问题。

我运行 brew install homebrew / php / php56-mysqlnd_ms

但现在我一直收到此错误< / p>

  PHP警告:PHP启动:无法加载动态库'/usr/local/opt/php56-mcrypt/mcrypt.so' -  dlopen(/ usr / local / opt /  php56-mcrypt / mcrypt.so,9):在第0行的未知中找不到图像
 
警告:PHP启动:无法加载动态库'/usr/local/opt/php56-mcrypt/mcrypt.so' -  dlopen  (/usr/local/opt/php56-mcrypt/mcrypt.so,9):在第0行的未知中找不到图像
phpinfo()
 
PHP Version =&gt;  5.6.21 
   
 
 

有人知道如何解决此错误吗? 我不知所措

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongzhashou0116 2016-04-29 08:40
    已采纳

    You are missing mcrypt . You can try ,

    brew install php54-mcrypt --without-homebrew-php

    And then , in /etc/php.ini add,

    extension="/usr/local/Cellar/php54-mcrypt/5.4.24/mcrypt.so"

    I hope this will help , please let us know

    点赞 评论
  • douhai9043 2016-04-29 08:39

    Seems that you have to install the module mcrypt of php.

    brew update
    brew upgrade
    brew tap homebrew/dupes
    brew tap josegonzalez/homebrew-php
    brew install php54-mcrypt
    sudo composer update
    

    Other thing that if you want to use mac and linux you can use Vagrant, is really nice how it works with virtualbox + vagrant you can have stack on other OS.

    https://www.vagrantup.com/

    And this is a nice project with vagrant for install all the the technologies you need.

    https://github.com/fideloper/Vaprobash

    点赞 评论

相关推荐 更多相似问题