# README.WIN32-BUILD-SYSTEM

- Thread: https://externals.io/message/37578
- Original archive: https://news-web.php.net/php.internals/37578
- Started by Hector Santos on 2008-05-11T06:43:27+00:00
- Messages: 12
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #37578 — Hector Santos — 2008-05-11T06:43:27+00:00

URL: https://externals.io/message/37578#37578

I'm new to PHP development, so please have some patience with me here. 
Once I get the "AH HA", I will be eagerly contributing.

With my PHP-5.2.5 source code installation, I was able to finally able 
to use the WIN32\*.DSP projects, with some changes as noted in a 
previous post, to create a new PHP5TS.DLL file.

Comparing the two image sizes:

    4,796,472 php5ts.dll   (official 5.2.5 release)
    4,763,648 php5ts.dll   (new release_ts_inline)

With almost the same size gave me the initial "good news" impression 
that I was doing it right.

Replacing the new PHP5DLL.DLL in my official WIn32 binary PHP525 
installation, I tested it against many of my PHP extension scripts and 
they all seems to work.

However in looking at the exported functions from the official release 
binary and new this build, there is drastic different.

A diff of the DUMPBIN.EXE /EXPORTS shows items that were not included 
and others included (see attached dumpbin-diff-php5ts.txt).

If someone can give me the skinny on the items in the diff file, what 
are do they reflect, why there is a different, I can begin to get a 
better handle of this PHP development environment.

This got me to think that I probably do not have a good handle on this 
"CONFIGURE.JS" stuff or that the 2003 version of this 
README.WIN32-BUILD-SYSTEM file is simply out of date given that there 
are *.DSP project files available.   I started fresh again with new copy 
of PHP-5.2.6 and tried to follow this but I am getting an compiler error 
with LIBXML/PARSER.H.  I can probably figure this out, but I do have one 
question.  In this README file, it says in section 1:

   You also need:

   - bindlib_w32 [http://www.php.net/extra/bindlib_w32.zip]
   - win32build  [http://www.php.net/extra/win32build.zip]

but it doesn't say where to unzip this. I presume it would be off the 
PHP-5.2.6\ folder, but under what folder names expected by the PHP 
source code?

I would love to clean this all up for PHP Windows developers so if 
someone can give me the "AH HA" behind all this, that would be great.

Once I am able to reproduce the exact official release PHP5TS.DLL image 
for Win32, then I know I am on the right track.

TIA

-- 
Hector Santos

---

## #37580 — Hector Santos — 2008-05-11T08:19:08+00:00

URL: https://externals.io/message/37578#37580 · In reply to: #37578

Hector Santos wrote:
 > ...
 >
> I would love to clean this all up for PHP Windows developers so if 
> someone can give me the "AH HA" behind all this, that would be great.

Ok folks, never mind. The web page "Building from Source" at:

   http://uk3.php.net/manual/en/install.windows.building.php

is making sense, answering all the questions for me, including this note 
regarding the un-maintained/legacy DSW project files:

      Building PHP using DSW files [PHP 4]

      Compiling PHP using the DSW files isn't supported as of
      PHP 5, as a much more flexible system was made available.
      Anyway, you can still use them, but keep in mind that they
      are not maintained very often, so you can have compiling
      problems. To compile PHP 4 for windows, this is the only
      available way though.

Once I get the "official maintained" command-line building method worked 
out, I will update the Visual Studio project/solution files for both VS 
6.0 and VS 2005 (which is what I have).  When I cross that bridge, I'll 
ask someone to test the VS 2008 Express version.

Thanks

-- 
Hector Santos

---

## #37581 — Pierre Joye — 2008-05-11T08:52:00+00:00

URL: https://externals.io/message/37578#37581 · In reply to: #37580

Hi Hector,



>      Building PHP using DSW files [PHP 4]
>
>      Compiling PHP using the DSW files isn't supported as of
>      PHP 5, as a much more flexible system was made available.
>      Anyway, you can still use them, but keep in mind that they
>      are not maintained very often, so you can have compiling
>      problems. To compile PHP 4 for windows, this is the only
>      available way though.

PHP4 is dead, any second spent on building it on windows is a wasted second :)

>  Once I get the "official maintained" command-line building method worked
> out, I will update the Visual Studio project/solution files for both VS 6.0
> and VS 2005 (which is what I have).  When I cross that bridge, I'll ask
> someone to test the VS 2008 Express version.

That would not be very useful. Nobody uses them and they are outdated.
The normal and supported way is the cscript + nmake, which works for
all VS (we are working on supporting 2k5/8 these days, incl. the
deps).

As Bjori pointed out, there is also updated information in the wiki,
please consider to read it.

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #37583 — Hector Santos — 2008-05-11T10:01:26+00:00

URL: https://externals.io/message/37578#37583 · In reply to: #37581

Pierre Joye wrote:
> Hi Hector,
> 
> 
> 
> > […]
> 
> PHP4 is dead, any second spent on building it on windows is a wasted second :)

Ok, then may I suggest the *.DSP/DSW project files in the PHP5+ 
distribution either a) removed from the distribution, or b) updated.

> > […]
> 
> That would not be very useful. Nobody uses them and they are outdated.

Of course, thats a subjective opinion whether they are useful or not. :-)

I use project files and I am sure if they were made available (and 
working) others will use them as well.  One reason, and not exclusively 
the reason, is that it provides the fast learning method to understand 
the PHP model, framework and more especially, the organization of this 
source files.

Of course, PHP has evolved with a high focus for consoled-based 
configuration preprocessing logic that needs to be done.  However, this 
can also be done via a PRE-COMPILE and/or a special "CONFIGURE" project 
which all other projects are dependent on.  This project can use a 
pre-compile setup that runs the cscript stuff.

> As Bjori pointed out, there is also updated information in the wiki,
> please consider to read it.

Which wiki?  I found the link I noted in my previous message:

    http://uk3.php.net/manual/en/install.windows.building.php

and this is helping.  Is this info sufficient or is there more?

Anyway, at this moment I'm moving along and off hand, it appears the 
remaining item which is ambiguous is the LIBXML and ICONV stuff.  There 
is a note about in the above link but doesn't say much about preparation.

I don't understand why the CVS bundle folder has this as dead files, if 
they are still required for a build.

Thanks for your input Pierre.

-- 
Hector Santos

---

## #37585 — Pierre Joye — 2008-05-11T10:10:55+00:00

URL: https://externals.io/message/37578#37585 · In reply to: #37583

hi Hector,



>  Ok, then may I suggest the *.DSP/DSW project files in the PHP5+
> distribution either a) removed from the distribution, or b) updated.

Removing them sounds like the best option yes.


>  Of course, thats a subjective opinion whether they are useful or not. :-)
>
>  I use project files and I am sure if they were made available (and working)
> others will use them as well.  One reason, and not exclusively the reason,
> is that it provides the fast learning method to understand the PHP model,
> framework and more especially, the organization of this source files.

It is not really subjective, it is based on our experiences and
feedbacks from other users. It is already enough work to keep
everything up and running. Project files have no benefit over the
current script. You can still use the VC GUI to debug or develop
without them.

However, I have very good hope that our current evaluation of the
CMake tools will allow anyone to generate them using a common script
(common to all platforms or build tools). But that's another topic :)

> > […]
>
>  Which wiki?  I found the link I noted in my previous message:

http://wiki.php.net

>    http://uk3.php.net/manual/en/install.windows.building.php
>
>  and this is helping.  Is this info sufficient or is there more?
>
>  Anyway, at this moment I'm moving along and off hand, it appears the
> remaining item which is ambiguous is the LIBXML and ICONV stuff.  There is a
> note about in the above link but doesn't say much about preparation.

We are also documenting these steps in the wiki. The required
libraries are also available for each VC version (built using these
versions). There is still a lot to do but we are on the right track.
If you like to write a howto for beginners out of your experiences,
you will be more than welcome :-)

>  I don't understand why the CVS bundle folder has this as dead files, if
> they are still required for a build.

Which CVS bundle folder?

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #37593 — Hector Santos — 2008-05-11T13:14:47+00:00

URL: https://externals.io/message/37578#37593 · In reply to: #37585

Pierre Joye wrote:

> > […]
 >
 > Removing them sounds like the best option yes.

I hope not. :-)

 > It is not really subjective, it is based on our experiences and
 > feedbacks from other users.

It still subjective. :-)  Besides, I would venture the negative 
experiences were based on the fact they never updated so people were 
having "headache causing" issues. Based on what I seen so far, compiling 
via current method is like pulling teeth.  :-)

 > It is already enough work to keep everything up and running.

Sure, so the more automation "out the box" the better.  Anyway, IMV, 
you will never let go the need to support smart frontends.

 > Project files have no benefit over the current script.

Well, I don't see why not.  You can do the same thing via project files 
- see the "Custom Build", "Pre-Link", "Post-Build" tabs.   In fact, I am 
going to prove it when I can the chance. (BTW, I program almost 
exclusively under a console, so its not "windows-users" thing.)

 > If you like to write a howto for beginners out of your experiences,
 > you will be more than welcome :-)

I have started this and my first test of instructions and new batch 
files was perfect for php 5.2.5, however re-running it for PHP 5.2.6 
errored out on an unresolved link for:

              xmlXPathCompiledEvalToBoolean

Removing this from the release_ts\php5ts.dll.def allowed it to 
successfully link.

I have not deeply stupid why yet, but I did noticed in the Changelog 
comments related to this function:

      2006-09-07  Rob Richards  <rrichards@ctindustries.net>

     * (PHP_5_2)
       ext/libxml/php_libxml2.def:
       MFH: fix def file for 2.6.26 (xmlXPathCompiledEvalToBoolean
       required in .27)

     * ext/libxml/php_libxml2.def:
       fix def file for 2.6.26 (xmlXPathCompiledEvalToBoolean
       required in .27)

> > […]
 >
 > Which CVS bundle folder?

    http://cvs.php.net/viewvc.cgi/php-src/

--
Hector Santos

---

## #37594 — Pierre Joye — 2008-05-11T13:32:25+00:00

URL: https://externals.io/message/37578#37594 · In reply to: #37593

Hi Hector,



> > […]
>
>  It still subjective. :-)  Besides, I would venture the negative experiences
> were based on the fact they never updated so people were having "headache
> causing" issues. Based on what I seen so far, compiling via current method
> is like pulling teeth.  :-)

What is hard in:

1. mkdir c:\phpw32
2. extract a php release in c:\phpw32\php-5.y.z
3. extract the dependencies in c:\phpw32\php_builds
4. run:
 buildconf.bat
 configure.bat [option your like to have}
 nmake



> > […]
>
>  Sure, so the more automation "out the box" the better.  Anyway, IMV, you
> will never let go the need to support smart frontends.

Smart? We do not support them whether they are smart or not is not the point ;)

> > […]
>
>  Well, I don't see why not.  You can do the same thing via project files -
> see the "Custom Build", "Pre-Link", "Post-Build" tabs.   In fact, I am going
> to prove it when I can the chance. (BTW, I program almost exclusively under
> a console, so its not "windows-users" thing.)

My point is to focus on what we actually need or work on. I will not
try to stop you on your attempt to fix the VC project files but it is
not what we need.

If you like to help us in the windows build process then there is
numerous ways to do it:

- help us to document the process
- help us to build more dependencies as well porting some of them to
Windows (and Visual c++ 6/2005/2008)
- test our builds

The other reasons why projects file are useless for us is their static
nature. Unless we write a sln generator, it makes little sense to use
them when you work with php, PECL and your own extensions. And that's
we do for the PHP releases and our developments.

> > […]
>
>  I have started this and my first test of instructions and new batch files
> was perfect for php 5.2.5, however re-running it for PHP 5.2.6 errored out
> on an unresolved link for:
>
>              xmlXPathCompiledEvalToBoolean
>
>  Removing this from the release_ts\php5ts.dll.def allowed it to successfully
> link.
>
>  I have not deeply stupid why yet, but I did noticed in the Changelog
> comments related to this function:

Have you read the wiki? :) Please fetch the libxml we use for 5.2.6 here:

http://pecl2.php.net/downloads/php-windows-builds/php-libs/ (use the
right version with your compiler)


> > […]
>
>    http://cvs.php.net/viewvc.cgi/php-src/


That's the main PHP CVS module.

Cheers,
-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #37595 — Hector Santos — 2008-05-11T13:44:37+00:00

URL: https://externals.io/message/37578#37595 · In reply to: #37594

Pierre Joye wrote:

> > […]
> 
> What is hard in:
> 
> 3. extract the dependencies in c:\phpw32\php_builds

Summarize, define dependencies.

> > […]
> 
> Have you read the wiki? :) Please fetch the libxml we use for 5.2.6 here:

Been there. But I'll check it out again later.  The best success was 
getting the EDIN zip and use this for all the extras.  But there might 
be issue with 5.2.6.  I'll check that out later too.

> > […]

> That's the main PHP CVS module.

And what does that mean?  Why are the bundle files dead? Is this related 
to the idea that LIBXML is now part of the core?

-- 
Hector Santos

---

## #37596 — Steph Fox — 2008-05-11T13:48:21+00:00

URL: https://externals.io/message/37578#37596 · In reply to: #37594

> What is hard in:
>
> 1. mkdir c:\phpw32
> 2. extract a php release in c:\phpw32\php-5.y.z
> 3. extract the dependencies in c:\phpw32\php_builds
> 4. run:
> buildconf.bat
> configure.bat [option your like to have}
> nmake

What is hard in it is that this is pretty alien for someone used to working 
with .dsp files or whatever. Also, under Windows you need to bring the MS 
headers into play, which means running vcvars. (vc32vars.bat, whatever.) The 
same thing happens when you use Visual Studio, but you don't see it there 
because it's disguised as Tools/Options/Directories and obviously is 'just 
called'. In our setup it needs to be called explicitly, unless the MS 
headers are already in your PATH. You'll also need to add the path to your 
PHP libs and headers to vcvars.bat, you can do this via MSVC or manually.

configure.bat has been in 5_3 only for the last few weeks, so that part 
depends on the PHP version you're building. But buildconf will tell you what 
to do next anyway.

- Steph

---

## #37597 — Steph Fox — 2008-05-11T13:53:32+00:00

URL: https://externals.io/message/37578#37597 · In reply to: #37595

> Been there. But I'll check it out again later.  The best success was 
> getting the EDIN zip and use this for all the extras.  But there might be 
> issue with 5.2.6.  I'll check that out later too.

No, it's libxml. You need to update it. Same with many other things on the 
link Pierre gave you, which replaces the old zip.zip because Edin no longer 
has enough hours in the day to keep that updated.

> And what does that mean?  Why are the bundle files dead? Is this related 
> to the idea that LIBXML is now part of the core?

Someone (Sterling?) bundled it a million years ago and it was unbundled 
later, you just can't build PHP without it. ext/libxml is a wrapper, not the 
library itself.

- Steph

---

## #37598 — Pierre Joye — 2008-05-11T13:56:39+00:00

URL: https://externals.io/message/37578#37598 · In reply to: #37595

> Pierre Joye wrote:
>
>
> > […]
>
>  Summarize, define dependencies.

The libraries required by PHP. Like libxml2, iconv, etc. We should be
done with all PHP core dependencies soon (for vc6, 2k5 and 2k8).

> > […]
>
>  Been there. But I'll check it out again later.  The best success was
> getting the EDIN zip and use this for all the extras.  But there might be
> issue with 5.2.6.  I'll check that out later too.


Use the libxml2 from pecl2 will solve this exact issue. I also
recommend to fetch zlib and iconv. And Openssl if you need the
ext/openssl extension.

> > […]
>
>
> > […]
>
>  And what does that mean?  Why are the bundle files dead? Is this related to
> the idea that LIBXML is now part of the core?

The only libraries that are bundled in the PHP sources (what you have
in cvs and in the source releases) are pcre and gd (for the extensions
enabled by default). There may be other in optional extensions (like
in mbstring).

LibXml2 is not part of the php sources and you have to use the same
version (or at least compatible with) the version we used.

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

---

## #37599 — Elizabeth M Smith — 2008-05-11T13:59:27+00:00

URL: https://externals.io/message/37578#37599 · In reply to: #37596

Steph Fox wrote:
> > […]
> 
> What is hard in it is that this is pretty alien for someone used to
> working with .dsp files or whatever. Also, under Windows you need to
> bring the MS headers into play, which means running vcvars.
> (vc32vars.bat, whatever.) The same thing happens when you use Visual
> Studio, but you don't see it there because it's disguised as
> Tools/Options/Directories and obviously is 'just called'.

That's why I usually just tell people to run the shortcut in their start
menu that sets this up (Visual Studio Command Prompt) and then cd to the
php source ;)

In our setup
> it needs to be called explicitly, unless the MS headers are already in
> your PATH. You'll also need to add the path to your PHP libs and headers
> to vcvars.bat, you can do this via MSVC or manually.

Err- no you don't steph :)  you can use the --php_build="path" switch to
tell our configure system where to look for the libs, or just put them
in a library called php_build parallel to your php5 source, don't make
things harder then they have to be ;)

> 
> configure.bat has been in 5_3 only for the last few weeks, so that part
> depends on the PHP version you're building. But buildconf will tell you
> what to do next anyway.
> 
> - Steph
