如何编译PECL php_intl库?

时间:2011-09-02 15:10:22

标签: php visual-studio-2010 compilation pecl

我需要 php_intl.dll for PHP 5.3.5( VC6 )。

我无法在任何地方找到它,所以我决定下载源代码并自行编译。

我已经下载了Microsoft Visual C ++ Studio Express 2010(带有C ++编译器的版本)的评估版。

我在.tgz包中下载了源代码并将其解压缩到我的桌面(名为intl-1.1.2的新闪亮文件夹)。

现在我打开Visual C ++ Studio,我转到 NEW - >来自现有代码的项目

并指向我桌面上的intl-1.1.2文件夹。

然后我点击我新创建的“解决方案”并点击“BUILD SOLUTION”,这就是我得到的:

1>------ Build started: Project: php_intl, Configuration: Debug Win32 ------
1>  resourcebundle_iterator.c
1>resourcebundle\resourcebundle_iterator.c(17): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  resourcebundle_class.c
1>resourcebundle\resourcebundle_class.c(18): fatal error C1083: Cannot open include file: 'unicode/ures.h': No such file or directory
1>  resourcebundle.c
1>resourcebundle\resourcebundle.c(17): fatal error C1083: Cannot open include file: 'unicode/ures.h': No such file or directory
1>  php_intl.c
1>c:\users\loostro\desktop\intl-1.1.2\php_intl.h(23): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  normalizer_normalize.c
1>normalizer\normalizer_normalize.c(21): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  normalizer_class.c
1>c:\users\loostro\desktop\intl-1.1.2\normalizer\normalizer_class.h(20): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  normalizer.c
1>c:\users\loostro\desktop\intl-1.1.2\normalizer\normalizer_class.h(20): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  msgformat_parse.c
1>msgformat\msgformat_parse.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  msgformat_format.c
1>msgformat\msgformat_format.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  msgformat_data.c
1>msgformat\msgformat_data.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  msgformat_class.c
1>msgformat\msgformat_class.c(17): fatal error C1083: Cannot open include file: 'unicode/unum.h': No such file or directory
1>  msgformat_attr.c
1>msgformat\msgformat_attr.c(21): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  msgformat.c
1>msgformat\msgformat.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  locale_methods.c
1>locale\locale_methods.c(23): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  locale_class.c
1>locale\locale_class.c(19): fatal error C1083: Cannot open include file: 'unicode/uloc.h': No such file or directory
1>  locale.c
1>c:\users\loostro\desktop\intl-1.1.2\locale\locale_class.h(22): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  intl_error.c
1>intl_error.c(23): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  intl_convert.c
1>intl_convert.c(22): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  idn.c
1>idn\idn.c(25): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  grapheme_util.c
1>grapheme\grapheme_util.c(22): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  Generating Code...
1>  Compiling...
1>  grapheme_string.c
1>grapheme\grapheme_string.c(22): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  formatter_parse.c
1>formatter\formatter_parse.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  formatter_main.c
1>formatter\formatter_main.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  formatter_format.c
1>formatter\formatter_format.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  formatter_data.c
1>c:\users\loostro\desktop\intl-1.1.2\formatter\formatter_data.h(20): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  formatter_class.c
1>formatter\formatter_class.c(17): fatal error C1083: Cannot open include file: 'unicode/unum.h': No such file or directory
1>  formatter_attr.c
1>formatter\formatter_attr.c(21): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  formatter.c
1>formatter\formatter.c(21): fatal error C1083: Cannot open include file: 'unicode/utypes.h': No such file or directory
1>  dateformat_parse.c
1>dateformat\dateformat_parse.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  dateformat_format.c
1>dateformat\dateformat_format.c(21): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  dateformat_data.c
1>c:\users\loostro\desktop\intl-1.1.2\dateformat\dateformat_data.h(19): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  dateformat_class.c
1>dateformat\dateformat_class.c(16): fatal error C1083: Cannot open include file: 'unicode/unum.h': No such file or directory
1>  dateformat_attr.c
1>dateformat\dateformat_attr.c(20): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  dateformat.c
1>dateformat\dateformat.c(20): fatal error C1083: Cannot open include file: 'unicode/ustring.h': No such file or directory
1>  common_error.c
1>common\common_error.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  collator_sort.c
1>collator\collator_sort.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  collator_locale.c
1>collator\collator_locale.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  collator_is_numeric.c
1>c:\users\loostro\desktop\intl-1.1.2\collator\collator_is_numeric.h(21): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  collator_error.c
1>collator\collator_error.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  collator_create.c
1>collator\collator_create.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  Generating Code...
1>  Compiling...
1>  collator_convert.c
1>collator\collator_convert.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  collator_compare.c
1>collator\collator_compare.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  collator_class.c
1>c:\users\loostro\desktop\intl-1.1.2\collator\collator_class.h(21): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  collator_attr.c
1>collator\collator_attr.c(22): fatal error C1083: Cannot open include file: 'php_intl.h': No such file or directory
1>  collator.c
1>c:\users\loostro\desktop\intl-1.1.2\collator\collator_class.h(21): fatal error C1083: Cannot open include file: 'php.h': No such file or directory
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

请帮助我,我做错了什么?

1 个答案:

答案 0 :(得分:1)

我不知道如何在Windows上执行此操作。在Linux上,你需要一个通常称为php5-dev的软件包(在基于Debian的系统上)。然后,您只需下载pecl包,然后:

cd /path/to/pecl/package/intl
phpize
./configure
make && make install

如果你可以获得pecl二进制文件(pecl.exe)它可能更容易,你只需要在控制台上运行它:

pecl install intl