Как скомпилировать библиотеку PECL php_intl? - PullRequest
2 голосов
/ 02 сентября 2011

Мне нужно php_intl.dll для 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 на рабочем столе.

Затем я нажимаю на свое недавно созданное «решение» и нажимаю «Построить решение», и вот что я получаю:

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 Ответ

1 голос
/ 14 октября 2011

Понятия не имею, как это сделать в Windows.В Linux вам нужен пакет, который обычно называется php5-dev (в системах на основе Debian).Затем вы просто скачиваете пакет pecl и:

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

Если вы можете получить двоичный файл pecl (pecl.exe), это может быть проще, вам просто нужно запустить его на консоли:

pecl install intl
...