Excel 조작을위한 널리 사용되는 C 라이브러리 인 LibXL과 함께 Windows에서 PHP를 빌드하려고합니다. 이 라이브러리에는 php_excel이라는 기본 PHP 객체 기반 확장자가 있습니다. 후자를 Windows 용 공유 DLL로 빌드하려고 시도하고 있습니다. 분산 형으로 PHP에 정적으로 컴파일하는 것이 아닙니다.Windows에서 php_excel 및 LibXL 컴파일
필자가 컴파일을 시작하는 시점은 Windows 용 PHP buidling wiki entry이며 Visual Studio 2008 및 Windows SDK 6.1을 권장대로 사용하고 있습니다. 이 설명에서 추가 경로의 목적을 위해, 내 참조 디렉토리는 c:\php-sdk\php53dev\vc9\x86\
입니다. PHP 스냅 샷에 대한 참조는 php5.3-x
폴더로 표시됩니다. 여기서 x는 스냅 샷 빌드 datetime입니다. PHP는 스냅 샷의 추출 후
deps
에 각각의 폴더에
bin\libxl.dll
,
include_c\*
및
lib\libxl.lib
을 추가 해요.
다음으로 php_excel 확장자를 php5.3-x\ext\excel-0.9.1
으로 추출합니다.
buildconf
및 configure --help
을 실행하면 확장이 표시되는 것으로 나타납니다. 나는 다음을 실행하고있다 :
configure --disable-all --enable-cli --with-excel=shared --disable-zts --disable-isapi --disable-nsapi
nmake
DLL의 비 스레드 세이프 빌드를 달성하려면. nmake
에
, 나는 LibXL의 모든 헤더 파일을 구문 오류에 대항 간다 : php_excel에 대한 excel.c 소스의
c:\php-sdk\php53dev\vc9\x86\deps\include\enum.h(4) : error C2061: syntax error: identifier 'libxl'
c:\php-sdk\php53dev\vc9\x86\deps\include\enum.h(4) : error C2059: syntax error: ';'
...
및 구문 오류 : 여기
ext\excel-0.9.1\excel.c(33) : error C2146: syntax error : missing ')' before identifier 'f'
ext\excel-0.9.1\excel.c(33) : error C2061: syntax error : identifier 'f'
ext\excel-0.9.1\excel.c(33) : error C2059: syntax error : ';'
ext\excel-0.9.1\excel.c(33) : error C2059: syntax error : ')'
...
, 예를 들어 각 파일의 다음 두 섹션이 있습니다.
enum.h
#ifndef ENUM_CPP_H
#define ENUM_CPP_H
namespace libxl { # line 4
...
}
excel.c
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "libxl.h"
#include <stdlib.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/date/php_date.h"
#include "php_excel.h"
#include "zend_exceptions.h"
static long xlFormatBorder(FormatHandle f) # line 33
{
return 1;
}
syn 세금 오류는 있지만 어딘가에서 분명한 단계를 놓치고 있다고 가정합니까?
많은 분들께 감사드립니다. 나는 여전히 이러한 컴파일을 로컬로하고 싶습니다. 심지어 [php_excel] 버전을 사용할 때도 같은 오류가 발생합니다. [변경 커밋] (https://github.com/iliaal/php_excel/commit/4aa7a522b8c52d2956a8765f219bdfa3a9ba8ef4)과 새로운 오늘 아침부터 PHP 5.3 스냅 샷. 이것은 TS 및 NTS 빌드 용입니다. –
피에르 다시 한번 감사드립니다. [최신 커밋] (https://github.com/pierrejoye/php_excel/commit/2e4ceedb792d849475310f45e0f6efc6efff431f)으로 컴파일됩니다. –