Missing libxml/parser.h When Compiling PHP 5.2.8

sctccomm
sctccomm used Ask the Experts™
on
Hello,

I am currently attempting to recompile a specific version of PHP (5.2.8) on Windows XP, which is provided with my web server, Appweb.  In this compilation, I am adding DOM and XML support, but I get a compilation error related to 'libxml/parser.h'.

I do not necessarily require that PHP version be 5.2.8, but I was less successful with 5.2.10 and 5.3.  Through another question previously posted, I was able to get a copy of the PHP 5.2.8 source code that Appweb provides, which seems to be compiling further than the latest versions of PHP.

The compilation error seems to be asking for a file that does not exist within the source code.  I have checked versions 5.2.8, 5.2.10, and 5.3, and they all do not have the file that is missing.  Thus, I do not know what should be done to resolve this issue.

Code snippets show the configuration I am using, the result of the configuration, and the compilation output I receive.

My system information is as follows:
OS:   Windows XP
IDE:   Microsoft Visual Studio 2008
PHP: 5.2.8

Thank you.
CONFIGURATION:
>cscript /nologo configure.js \
  --without-gd --disable-bcmath --disable-calendar --disable-com-dotnet \
  --disable-filter --disable-json --disable-ipv6 --disable-odbc \
  --disable-reflection --disable-tokenizer --disable-zlib --disable-ftp \
  --enable-embed --enable-zts --with-dom --with-libxml
 
 
CONFIGURE OUTPUT:
>cscript /nologo configure.js --without-gd --disable-bcmath --disable-calendar --disable-com-dotnet --disable-filter --disable-json --disable-ipv6 --disable-odbc --disable-reflection --disa
ble-tokenizer --disable-zlib --disable-ftp --enable-embed --enable-zts --with-dom --with-libxml
Saving configure options to config.nice.bat
Checking for cl.exe ...  <in default path>
Checking for cl.exe ...  <in default path>
Detected MS compiler version 15
Detected 32-bit compiler
Checking for link.exe ...  F:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
Checking for nmake.exe ...  <in default path>
Checking for lib.exe ...  <in default path>
Checking for bison.exe ...  <in default path>
Checking for flex.exe ...  <in default path>
Checking for re2c.exe ...  <not found>
Checking for zip.exe ...  <not found>
Checking for lemon.exe ...  <not found>
Checking for mc.exe ...  C:\Program Files\\Microsoft SDKs\Windows\v6.0A\bin
Checking for mt.exe ...  C:\Program Files\\Microsoft SDKs\Windows\v6.0A\bin
Checking for arpa\nameser.h ...  ..\win32build\include
Checking for library resolv.lib ... ..\win32build\lib\resolv.lib
 
Build dir: Release_TS
PHP Core:  php5ts.dll and php5ts.lib
 
Checking for NewAPIs.h ...  <not found>
Checking for NewAPIs.h ...  <not found>
Enabling SAPI sapi\cgi
Enabling SAPI sapi\cli
Enabling SAPI sapi\embed
Enabling extension ext\ctype
Enabling extension ext\date
Enabling extension ext\hash
Checking for iconv.h ...  <not found>
Checking for iconv.h ...  <not found>
Enabling extension ext\pcre
Enabling extension ext\session
Enabling extension ext\spl
Checking for timelib_config.h ...  ext/date/lib
Enabling extension ext\standard
Checking for library libxml2_a_dll.lib;libxml2_a.lib ... <not found>
Enabling extension ext\dom
Enabling extension ext\simplexml
Enabling extension ext\wddx
Checking for timelib_config.h ...  ext/date/lib
Enabling extension ext\xml
Enabling extension ext\xmlreader
Checking for libxml/xmlwriter.h ...  <not found>
Checking for libxml/xmlwriter.h ...  <not found>
WARNING: Could not find xmlwriter.h
 
 
Creating build dirs...
Generating files...
Generating Makefile
Generating main/internal_functions.c
        [content unchanged; skipping]
Generating main/config.w32.h
Done.
 
Type 'nmake' to build PHP
 
 
COMPILATION:
>nmake
 
Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.
 
        type ext\pcre\php_pcre.def > Release_TS\php5ts.dll.def
cgi_main.c
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(502) : warning
 C4142: benign redefinition of type
sapi\cgi\cgi_main.c(470) : warning C4018: '<' : signed/unsigned mismatch
fastcgi.c
getopt.c
zend.c
zend_API.c
zend_alloc.c
Zend\zend_alloc.c(36) : warning C4005: '_WIN32_WINNT' : macro redefinition
        C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include\sdkddkver.h(151)
: see previous definition of '_WIN32_WINNT'
zend_builtin_functions.c
zend_compile.c
zend_constants.c
zend_default_classes.c
zend_dynamic_array.c
zend_exceptions.c
zend_execute.c
Zend\zend_execute.c(656) : warning C4018: '>=' : signed/unsigned mismatch
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(568)
: warning C4018: '<' : signed/unsigned mismatch
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(571)
: warning C4018: '>' : signed/unsigned mismatch
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(574)
: warning C4018: '<' : signed/unsigned mismatch
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(576)
: warning C4018: '>=' : signed/unsigned mismatch
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(1509)
 : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(15503
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(15536
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(15572
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(15603
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(16527
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(16560
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(16596
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(16627
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(17507
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(17540
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(17576
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(17607
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(18752
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(18785
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(18821
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(18852
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(19439
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21144
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21165
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21198
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21224
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21332
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21365
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21401
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(21432
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22653
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22674
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22707
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22733
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22841
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22874
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22910
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(22941
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24165
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24186
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24219
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24245
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24353
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24386
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24422
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(24453
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(25289
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(25310
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(25331
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26169
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26190
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26223
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26249
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26357
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26390
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26426
) : warning C4101: 'free_op1' : unreferenced local variable
f:\downloads\appweb server\appweb php\php\php-5.2.8\zend\zend_vm_execute.h(26457
) : warning C4101: 'free_op1' : unreferenced local variable
zend_execute_API.c
zend_extensions.c
zend_hash.c
zend_highlight.c
zend_indent.c
zend_ini.c
zend_ini_parser.c
zend_ini_scanner.c
zend_interfaces.c
Zend\zend_interfaces.c(345) : warning C4018: '<' : signed/unsigned mismatch
zend_iterators.c
zend_language_parser.c
zend_language_scanner.c
zend_list.c
zend_llist.c
zend_multibyte.c
zend_object_handlers.c
zend_objects.c
zend_objects_API.c
zend_opcode.c
zend_operators.c
zend_ptr_stack.c
zend_qsort.c
zend_sprintf.c
zend_stack.c
zend_stream.c
zend_strtod.c
Zend\zend_strtod.c(518) : warning C4018: '<=' : signed/unsigned mismatch
Zend\zend_strtod.c(1698) : warning C4244: '=' : conversion from 'volatile double
' to 'int', possible loss of data
Zend\zend_strtod.c(1716) : warning C4244: '=' : conversion from 'volatile double
' to 'int', possible loss of data
Zend\zend_strtod.c(1752) : warning C4244: '=' : conversion from 'volatile double
' to 'int', possible loss of data
Zend\zend_strtod.c(2542) : warning C4244: '=' : conversion from 'double' to 'int
', possible loss of data
zend_ts_hash.c
zend_variables.c
SAPI.c
fopen_wrappers.c
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(502) : warning
 C4142: benign redefinition of type
internal_functions.c
C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include\ws2tcpip.h(502) : warning
 C4142: benign redefinition of type
.\ext\dom/php_dom.h(33) : fatal error C1083: Cannot open include file: 'libxml/p
arser.h': No such file or directory
NMAKE : fatal error U1077: '"F:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.exe"' : return code '0x2'
Stop.

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Usually that's due to libxml2 not being installed. I haven't personally ever successfully compiled PHP on a Windows machine, but I've done it dozens of times on Linux boxes, and usually the fix is to install LIbXML2.

Commented:
This seems to have most, if not all, of the sources for the packages needed for PHP's extensions:

http://sourceforge.net/projects/gnuwin32/files/

libxml2 is under libxml about halfway down the page.

Author

Commented:
Can you help explain to me what I should do to use this package to get the PHP compilation to work?

Thank you.
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Author

Commented:
One thing I tried before was to download the libxml source code, and put the missing files into the PHP source code directory.  Eventually the compilation error came up with libxml itself, looking for a file that did not exist there.

If this is the correct direction to follow, I would assume that there should not be dependencies on other packages not included with PHP.

Commented:
Most compilation efforts are a matter of tracking down sources. So if LibXML has a dependency, then you may need to go search that out and install that dependency and so on until all the dependencies have been met.

Any reason in particular that you're trying to compile PHP in Windows? I've run a variety of PHP builds on all sorts of Windows boxes before and never ran into a situation where I absolutely needed to rebuild. (I almost did once, with a 64-bit situation, but I found a workaround).

Author

Commented:
I'm trying to recompile PHP 5.2.8, which was provided by Appweb.  Their original version does not include XML support, which I need to use.

I attempted to recompile PHP 5.2.10 and 5.3 using the same configurations that Appweb currently uses, except for the addition of DOM and XML, but I get WARNINGs when configuring the compilation, and also I get errors during compilation.  Appweb's PHP source code seems to compile better, except for the libxml files.

Author

Commented:
Is there a reason why PHP includes the libxml package, but not complete enough for it to compile?
Commented:
But if it's a Windows-based platform, why not just use a precompiled binary version that you download right from PHP's site?

The source includes all the pieces it needs to talk to other 3rd party packages. In some cases, it includes the full source, but that doesn't mean it includes all the dependencies, too. Trying to package all the depencies and sub-dependencies and sub-sub-depencies, etc... could potentially get messy (and result in an unnecessarily large source).

Keep in mind that the majority of PHP compilations are happening on Linux-type boxes which often come with (or have easy access to) all the dependencies, so this really only becomes a problem on Windows boxes when you're not using the pre-made binaries.

Author

Commented:
If I were to use the binary for php 5.2.10 or 5.3.0, I am not sure how it can be install on the Appweb server.

Commented:
It should just be a matter of backing up the original binaries and overwriting them with the new ones.

How were you planning on installing it once you recompiled?

Author

Commented:
Compiling is a major issue.  And the next step is to get it running on Appweb.  I tried, but was not successful with getting PHP 5.3.0 to be recognized by Appweb.

It is strange, in the install.txt file provided by PHP with the binary it says to use php5ts.dll, but this file is not included with the binaries.  Also it refers to directory 'sapi', which also does not exist.  So what I replaced with the original Appweb php5ts.dll was php5.dll from PHP binary directory.  And when I restart Appweb and run phpinfo(), it still says 5.2.8.

Author

Commented:
Well I was finally able to get a php5ts.dll file from the PHP 5.2.10 binary zip file.

I replaced the original php5ts.dll file in the bin folder of the Appweb directory with this new one, and it seems to be working as I expect.

Thank you gr8gonzo for all your help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial