从PHP 5.2.8源代码在Mac OSX(10.5)上安装mcrypt失败测试,​​我该怎么办?

时间:2009-10-13 16:51:23

标签: php macos mcrypt

所以我正在尝试在我的本地安装mcrypt进行开发。我以前从未编译过来,所以请耐心等待,但我所做的就是:

  1. 下载并安装libmcrypt-2.5.8(来自源代码)
  2. http://www.viames.it/mac-os-x.html下载已编译的mcrypt.so(注意:已编译的gd.so似乎工作正常)
  3. 更新php.ini(包含相关行)
  4. 重启网络共享(apache);页面无法加载
  5. 删除extension = mcrypt.so行并重新启动apache,再次加载页面
  6. 从php.net下载PHP 5.2.8源代码,并尝试从/ ext / mcrypt配置和安装mcrypt
  7. 此时,当我运行make test时,事情就失败了。

    Number of tests :   36                36
    Tests skipped   :    0 (  0.0%) --------
    Tests warned    :    0 (  0.0%) (  0.0%)
    Tests failed    :   36 (100.0%) (100.0%)
    Expected fail   :    0 (  0.0%) (  0.0%)
    Tests passed    :    0 (  0.0%) (  0.0%)
    

    以防万一,我继续做sudo make install,更新php.ini,并尝试加载页面。页面加载很好。我去了我的phpinfo页面,但根本没有显示mcrypt。我几次来回走动,但一切都没发生。

    我对现在该做什么很困惑,因为我不确定当make测试失败时我应该做什么,我怀疑,为什么我的mcrypt根本不起作用(即使.so文件就在那里)。我在下面列出了make test failed summary结果。

    非常感谢任何帮助:)

    FAILED TEST SUMMARY
    ---------------------------------------------------------------------
    Test for blowfish compatibility [tests/blowfish.phpt]
    Bug #35496 (Crash in mcrypt_generic()/mdecrypt_generic() without proper init). [tests/bug35496.phpt]
    Bug #37595 (mcrypt_generic calculates data length in wrong way) [tests/bug37595.phpt]
    Bug #41252 (Calling mcrypt_generic without first calling mcrypt_generic_init crashes) [tests/bug41252.phpt]
    Bug #46010 (warnings incorrectly generated for iv in ecb mode) [tests/bug46010.phpt]
    Bug #8040 (MCRYPT_MODE_* do not seem to exist) [tests/bug8040.phpt]
    mcrypt_cbc [tests/mcrypt_cbc.phpt]
    mcrypt_cbf [tests/mcrypt_cbf.phpt]
    mcrypt_create_iv [tests/mcrypt_create_iv.phpt]
    mcrypt_decrypt [tests/mcrypt_decrypt.phpt]
    mcrypt_ecb [tests/mcrypt_ecb.phpt]
    mcrypt_enc_get_algorithms_name [tests/mcrypt_enc_get_algorithms_name.phpt]
    mcrypt_enc_get_block_size [tests/mcrypt_enc_get_block_size.phpt]
    mcrypt_enc_get_iv_size [tests/mcrypt_enc_get_iv_size.phpt]
    mcrypt_enc_get_key_size [tests/mcrypt_enc_get_key_size.phpt]
    mcrypt_enc_get_modes_name [tests/mcrypt_enc_get_mode_name.phpt]
    mcrypt_enc_get_supported_key_sizes [tests/mcrypt_enc_get_supported_key_sizes.phpt]
    mcrypt_enc_is_block_algorithm [tests/mcrypt_enc_is_block_algorithm.phpt]
    mcrypt_enc_is_block_algorithm_mode [tests/mcrypt_enc_is_block_algorithm_mode.phpt]
    mcrypt_enc_is_block_mode [tests/mcrypt_enc_is_block_mode.phpt]
    mcrypt_enc_self_test [tests/mcrypt_enc_self_test.phpt]
    mcrypt_get_block_size [tests/mcrypt_get_block_size.phpt]
    mcrypt_get_cipher_name [tests/mcrypt_get_cipher_name.phpt]
    mcrypt_enc_get_iv_size [tests/mcrypt_get_iv_size.phpt]
    mcrypt_get_key_size [tests/mcrypt_get_key_size.phpt]
    mcrypt_list_algorithms [tests/mcrypt_list_algorithms.phpt]
    mcrypt_list_modes [tests/mcrypt_list_modes.phpt]
    mcrypt_module_get_algo_block_size [tests/mcrypt_module_get_algo_block_size.phpt]
    mcrypt_module_get_algo_key_size [tests/mcrypt_module_get_algo_key_size.phpt]
    mcrypt_module_get_supported_key_sizes [tests/mcrypt_module_get_supported_key_sizes.phpt]
    mcrypt_module_is_block_algorithm [tests/mcrypt_module_is_block_algorithm.phpt]
    mcrypt_module_is_block_algorithm_mode [tests/mcrypt_module_is_block_algorithm_mode.phpt]
    mcrypt_module_is_block_mode [tests/mcrypt_module_is_block_mode.phpt]
    mcrypt_module_open [tests/mcrypt_module_open.phpt]
    mcrypt_module_self_test [tests/mcrypt_module_self_test.phpt]
    mcrypt_ofb [tests/mcrypt_ofb.phpt]

1 个答案:

答案 0 :(得分:0)

通过AppStore安装Xcode

安装MacPorts(http://guide.macports.org/#installing.macports

使用端口

安装libmcrypt
port install libmcrypt

下载PHP源代码(http://php.net/downloads.php

在安装之前编译扩展程序

cd /directory/to/php/source/ext/mcrypt
phpize .
./configure \
--with-php-config=`which php-config` \
--with-mcrypt=/opt/local
make 
sudo make install