在 Mac OSX (10.5) 上从 PHP 5.2.8 源安装 mcrypt 测试失败,我该怎么办?
所以我尝试在本地安装 mcrypt 进行开发。我以前从未从源代码编译过,所以请耐心等待,但我所做的简短是:
- 下载并安装 libmcrypt-2.5.8 (从源代码)
- 从 http://www.viames.it/mac-os-x.html (注:编译后的gd.so 似乎工作正常)
- 更新 php.ini(以包含相关行)
- 重新启动网络共享(apache);页面无法加载
- 删除extension=mcrypt.so行并重新启动apache,页面再次加载)
- 从php.net下载PHP 5.2.8源,并尝试从/ext/mcrypt配置和安装mcrypt
此时,当我运行 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 测试失败的摘要结果。
任何帮助将不胜感激:)
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]
So I'm trying to install mcrypt on my local for development. I've never compiled from source before, so please bear with me, but the short of what I've done is:
- Download and install libmcrypt-2.5.8 (from source)
- Download compiled mcrypt.so from http://www.viames.it/mac-os-x.html (note: the compiled gd.so seems to work fine)
- Update php.ini (to include relevant lines)
- Restart web sharing (apache); pages can't be loaded
- Remove extension=mcrypt.so line and restart apache, pages load again)
- Download PHP 5.2.8 source from php.net, and try to configure and install mcrypt from /ext/mcrypt
At this point, when I run make test, things fail.
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%)
Just in case anyway, I went ahead and did sudo make install, update php.ini, and tried to load pages. Pages loaded fine. I went to my phpinfo page, but mcrypt isn't shown there at all. I went back and forth on this a couple of times, but nothing happened still.
I'm confused about what to do now, as I'm not sure what I was supposed to do when the make tests failed, which is, I suspect, why my mcrypt isn't working at all (even if the .so file is there). I'm including the make test failed summary result below.
Any help would be greatly appreciated :)
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]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过 AppStore 安装 Xcode
安装 MacPorts (http://guide.macports.org/#installing.macports)
使用端口安装 libmcrypt
下载 PHP 源 (http://php.net/downloads.php)
在安装之前编译扩展
Install Xcode via the AppStore
Install MacPorts (http://guide.macports.org/#installing.macports)
Install libmcrypt using port
Download PHP source (http://php.net/downloads.php)
Compile the extension before installing it