Windows build

php.internals

Edin Kadribasic

19 years ago
Hey, It seems that VC++ 8.0 (Visual Studio 2005) brings more trouble that its worth. Mainly the way it deals with the C runtime. After spending hours and hours of trying to figure out the way to make PHP work under Apache on Windows and be able to load extensions, I'm throwing in the towel. I can get PHP to work fine on the command line, both cgi and cli. It also works fine under IIS using fastcgi. But loading sapi dll into a webserver (not using php.exe or php-cgi.exe) works for the sapi itself, but trying to load any extensions via php.ini fails miserably. Sometimes you will get an error that the C runtime was attempted to be loaded in an illegal way, sometime PHP will claim that the extension does not exist, etc. I looked around at other projects and everyone seems to be using VC++ 6.0 for their builds (Active state, apache, ...) which eliminates all the hassle with bundling C runtime, etc. So I think the best thing for us would be to stick to the good old C compiler for making the Windows distro. Edin

Firman Wandayandi

19 years ago
Hi, On 1/6/07, Edin Kadribasic <edin@krug.dk> wrote:
> It seems that VC++ 8.0 (Visual Studio 2005) brings more trouble that its > worth. Mainly the way it deals with the C runtime. After spending hours > and hours of trying to figure out the way to make PHP work under Apache > on Windows and be able to load extensions, I'm throwing in the towel. > > I can get PHP to work fine on the command line, both cgi and cli. It > also works fine under IIS using fastcgi. But loading sapi dll into a > webserver (not using php.exe or php-cgi.exe) works for the sapi itself, > but trying to load any extensions via php.ini fails miserably. Sometimes > you will get an error that the C runtime was attempted to be loaded in > an illegal way, sometime PHP will claim that the extension does not > exist, etc. >
Confirmed.
> I looked around at other projects and everyone seems to be using VC++ > 6.0 for their builds (Active state, apache, ...) which eliminates all > the hassle with bundling C runtime, etc. > > So I think the best thing for us would be to stick to the good old C > compiler for making the Windows distro. >
I'm not sure which the best one of compiler. But agree, I think the old compiler is a right one ATM. While still investigating and finding the solution to make everything works. BTW, is it just suspend for swicthing to VC++ 8.0 or stick on the old one (for future plan) ?
-- Firman Wandayandi <http://firmanw.org/>

Ilia A.

19 years ago
Edin, Thanks for the detailed analysis and spending time analyzing the issue. Based on what you've said I think our best option is to go back to VC++ 6.0 for this release, we are too far along in the release cycle to experiment with things. Perhaps for the next release we can revisit the issue, assuming there an interest and a benefit of using VC++ 8.0 can be quantified. On 5-Jan-07, at 10:48 PM, Edin Kadribasic wrote:
> I looked around at other projects and everyone seems to be using VC++ > 6.0 for their builds (Active state, apache, ...) which eliminates all > the hassle with bundling C runtime, etc. > > So I think the best thing for us would be to stick to the good old C > compiler for making the Windows distro.
Ilia Alshanetsky

William A. Rowe, Jr.

19 years ago
This sounds like a sane approach. My own 2c is that your failure to load represents a failure to correctly package the .manifest data of the individual modules; perhaps this is due to the individual modules requiring an entry for php5ts.dll? Without digging deeper, it is probably most sane to ship vc 6 (or vc 7.1) binaries for now. But I'd strongly encourage research into vc 8, not for binary distribution, but because the MS Visual Studio 2005 Express Edition (available free) is your end users' most approachable platform for exploring and compiling the sources, without the cost of other VC compilers and without the stress of fighting with the hassles of the other open compiler alternatives. Ilia Alshanetsky wrote:

Marcus Börger

19 years ago
Hello Ilia, weel 2002 aka 7.0 or 2003 aka 7.1 are pretty fine. We have left behind 6.0 long ago :-) best regards marcus Saturday, January 6, 2007, 5:44:55 AM, you wrote:
> Edin,
> Thanks for the detailed analysis and spending time analyzing the > issue. Based on what you've said I think our best option is to go > back to VC++ 6.0 for this release, we are too far along in the > release cycle to experiment with things. Perhaps for the next release > we can revisit the issue, assuming there an interest and a benefit of > using VC++ 8.0 can be quantified.
> On 5-Jan-07, at 10:48 PM, Edin Kadribasic wrote:
>> I looked around at other projects and everyone seems to be using VC++ >> 6.0 for their builds (Active state, apache, ...) which eliminates all >> the hassle with bundling C runtime, etc. >> >> So I think the best thing for us would be to stick to the good old C >> compiler for making the Windows distro.
> Ilia Alshanetsky
Best regards, Marcus

Ilia A.

19 years ago
From what I know Edin uses VC++ 6.0 which works just fine for our needs. So, I see no reason to move away from that unless someone can present a really good reason why it should be done. On 6-Jan-07, at 2:48 PM, Marcus Boerger wrote:
> Hello Ilia, > > weel 2002 aka 7.0 or 2003 aka 7.1 are pretty fine. We have left > behind > 6.0 long ago :-) > > best regards > marcus > > Saturday, January 6, 2007, 5:44:55 AM, you wrote: > >> Edin, > >> Thanks for the detailed analysis and spending time analyzing the >> issue. Based on what you've said I think our best option is to go >> back to VC++ 6.0 for this release, we are too far along in the >> release cycle to experiment with things. Perhaps for the next release >> we can revisit the issue, assuming there an interest and a benefit of >> using VC++ 8.0 can be quantified. > >> On 5-Jan-07, at 10:48 PM, Edin Kadribasic wrote: > >>> I looked around at other projects and everyone seems to be using >>> VC++ >>> 6.0 for their builds (Active state, apache, ...) which eliminates >>> all >>> the hassle with bundling C runtime, etc. >>> >>> So I think the best thing for us would be to stick to the good old C >>> compiler for making the Windows distro. > >> Ilia Alshanetsky > > > > > Best regards, > Marcus >
Ilia Alshanetsky

William A. Rowe, Jr.

19 years ago
Marcus Boerger wrote:
> Hello Ilia, > > weel 2002 aka 7.0 or 2003 aka 7.1 are pretty fine. We have left behind > 6.0 long ago :-)
For reference, ActiveState python is built on Studio 2003 al la 7.1, while their perl is still built VC 6, if you are looking to coexist more peacefully with one or the other. Bill

Edin Kadribasic

19 years ago
William A. Rowe, Jr. wrote:
> Marcus Boerger wrote: >> Hello Ilia, >> >> weel 2002 aka 7.0 or 2003 aka 7.1 are pretty fine. We have left behind >> 6.0 long ago :-) > > For reference, ActiveState python is built on Studio 2003 al la 7.1, while > their perl is still built VC 6, if you are looking to coexist more peacefully > with one or the other.
More importantly, Apache is VC 6, and that is what was causing all the trouble with loading PHP extensions when running as an Apache module. Edin

Marcus Börger

19 years ago
Hello Edin, ok, i thought you would use the newer stuff already. Maybe if you have all withstaticruntime it *could* work. But I happen to have thesekinds of problems ofwork as well - a lot unfortunatley. best regards marcus Saturday, January 6, 2007, 10:14:17 PM, you wrote:
> William A. Rowe, Jr. wrote: >> Marcus Boerger wrote: >>> Hello Ilia, >>> >>> weel 2002 aka 7.0 or 2003 aka 7.1 are pretty fine. We have left behind >>> 6.0 long ago :-) >> >> For reference, ActiveState python is built on Studio 2003 al la 7.1, while >> their perl is still built VC 6, if you are looking to coexist more peacefully >> with one or the other.
> More importantly, Apache is VC 6, and that is what was causing all the > trouble with loading PHP extensions when running as an Apache module.
> Edin
Best regards, Marcus

William A. Rowe, Jr.

19 years ago
Edin Kadribasic wrote:
> > I can get PHP to work fine on the command line, both cgi and cli. It > also works fine under IIS using fastcgi. But loading sapi dll into a > webserver (not using php.exe or php-cgi.exe) works for the sapi itself, > but trying to load any extensions via php.ini fails miserably. Sometimes > you will get an error that the C runtime was attempted to be loaded in > an illegal way, sometime PHP will claim that the extension does not > exist, etc.
Questions; This is WinXP SP2 fully updated? (E.g. all security 'fixes' snuck in?) Extensions are located in the same directory as php5ts.dll itself? The webservers you are testing with use the same msvcr as the php build? (Depends.exe in the psdk or vc product is wonderful for inspecting this.)

Andi Gutmans

19 years ago
Hi Edin, Thanks for trying to get this to work! I think eventually it'll be the right move to go to VC8 but I agree that if it risks a successful 5.2.1 release then it might not be worth doing that right now. If you can share with us a reproducing case we can try and look into it and see if we can get it to work. So far we have concentrated on CLI/CGI/FastCGi because that's the most feasible way of running, but I agree that you also need to get the other methods to run. For those who are curious, there are some significant performance improvements in VC8. Our tolower() optimization which is significant is only for VC8, the compiler creates significantly faster code (on par with Intel C/C++ compiler), and I believe some of the CRT functions like time() are also much faster. So I think it's definitely worth upgrading but it should be well timed. Anyway, let us know and we'll try and dig deeper and help get this puppy ported and update the build. There probably is some work that needs to be done on the 3rd party libs. Thanks. Andi

Edin Kadribasic

19 years ago
Hi Andi, Turns out the problem is that Apache is building their binaries using VC6 so wrong CRT gets loaded. The only solution I found was to tell Windows to load Apache with msvcr80.dll instead of msvcr.dll by suppling a manifest file in Apache bin directory. If you crate Apache.exe.manifest that contains: <?xml version='1.0' encoding='UTF-8' standalone='yes'?> <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> </assembly> The Apache will load PHP and PHP will be able to load extensions. It probably isn't good idea to force a different C Runtime on Apache like this. Regarding performance, I found that on Zend/bench.php the improvement was only marginal (2%) compared to huge increase (25-30%) when disabling thread support. http://edin.dk/archives/25-Benchmarks.html Edin Andi Gutmans wrote:

William A. Rowe, Jr.

19 years ago
Edin Kadribasic wrote:
> Hi Andi, > > Turns out the problem is that Apache is building their binaries using > VC6 so wrong CRT gets loaded. The only solution I found was to tell > Windows to load Apache with msvcr80.dll instead of msvcr.dll by suppling > a manifest file in Apache bin directory. If you crate > Apache.exe.manifest that contains: > > <?xml version='1.0' encoding='UTF-8' standalone='yes'?> > <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> > <dependency> > <dependentAssembly> > <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' > version='8.0.50608.0' processorArchitecture='x86' > publicKeyToken='1fc8b3b9a1e18e3b' /> > </dependentAssembly> > </dependency> > </assembly> > > The Apache will load PHP and PHP will be able to load extensions. It > probably isn't good idea to force a different C Runtime on Apache like this.
FYI - If Apache adopted this convention, it would break on systems without the VC80 CRT - but worse... VC80 carries the baggage of installing WinSXS (side by side assemblies) for anything pre-XP. There are Apache VC80 binaries generated by others. But because Apache means to interoperate (for today) with ActivePerl/ActivePython, we weren't prepared to mess around any further with the breadth of bogosity that VC8 introduces. Apache's actively picking it up for source code builders, as I suggested in an earlier posting. From the ASF's perspective - folks exploring the Source is always the primary mission of the foundation. Will Apache bump to VC 7.1 or 8.0 with Apache 2.4? Who knows. But Apache 2.0 (as distributed) is legacy - it will never veer into VC7+ territory. And Apache 2.2 already shipped with VC6, so it's unlikely to change, as well. Mitigate binary compatibility breakage is the buzzword once an even-minor version has shipped. (Odd-minor's e.g. 2.3 are a moving target/development branch - no hassle there of disrupting users). A last interesting question; what sort of headaches have you hit loading within the ISAPI/IIS environment? I would presume that older/modern IIS flavors suffer from similar headaches? I do hang around here, so will be very curious to keep on top of the PHP project's progress w.r.t. Studio 2005.

Edin Kadribasic

19 years ago
> A last interesting question; what sort of headaches have you hit loading > within the ISAPI/IIS environment? I would presume that older/modern IIS > flavors suffer from similar headaches?
Seems that the least headache solution is to ship binaries built with VC6. I have not encountered any problems with that solution from Windows 95 - Windows Vista wrt loading CRT. Edin

Andi Gutmans

19 years ago
Hi Edin, The 2% surprises me a lot. We got very different results but it might be due to different hardware, OS (we use Windows Server 2003) and different tests. Here's what we got (all non-threadsafe): vc2005 intel msvc6 bench 9.326 9.378 10.28 hello 10.48 11.6 11.28 xoops 67.82 69.49 81.34 static 16.97 18.4 21.18 qdig 63.52 67.05 69.57 qdig2 14.4 15.61 19.04 Btw, today I never recommend running mod_php on Windows and always point people to CGI or existing FastCGI implementations. That said, I understand that you don't want to break things right now and stick to VC 6. Although I know it can work in some cases, I agree with you that running two CRTs is probably not a great idea. While the interfaces of the CRT functions might be identical, I am not sure all the structures are the same and that could cause some ugliness if we get structs like file handlers from the Apache executable passed into PHP and vice-versa. It's something worth looking into but not something one would want to rush for a minor version like 5.2.1. Andi

Andi Gutmans

19 years ago
Btw, I just saw that these VC 2005 binaries were with profile guided optimizations. Without those the performance was pretty much the same as the Intel compiler but still far better than VC6. Just wanted to clarify for accuracy. Andi

Ilia A.

19 years ago
I find that results showing that vc2005 generates better code then the one prepared by the intel compiler extremely usual. Was the test done on a non-intel (amd) machine by any chance? On 6-Jan-07, at 9:20 PM, Andi Gutmans wrote:
> Hi Edin, > > The 2% surprises me a lot. We got very different results but it > might be due > to different hardware, OS (we use Windows Server 2003) and > different tests. > Here's what we got (all non-threadsafe): > > vc2005 intel msvc6 > bench 9.326 9.378 10.28 > hello 10.48 11.6 11.28 > xoops 67.82 69.49 81.34 > static 16.97 18.4 21.18 > qdig 63.52 67.05 69.57 > qdig2 14.4 15.61 19.04 > > Btw, today I never recommend running mod_php on Windows and always > point > people to CGI or existing FastCGI implementations. > That said, I understand that you don't want to break things right > now and > stick to VC 6. Although I know it can work in some cases, I agree > with you > that running two CRTs is probably not a great idea. While the > interfaces of > the CRT functions might be identical, I am not sure all the > structures are > the same and that could cause some ugliness if we get structs like > file > handlers from the Apache executable passed into PHP and vice-versa. > > It's something worth looking into but not something one would want > to rush > for a minor version like 5.2.1. > > Andi > >> -----Original Message----- >> From: Edin Kadribasic [mailto:edin@krug.dk] >> Sent: Saturday, January 06, 2007 1:28 PM >> To: Andi Gutmans >> Cc: 'PHP Internals List' >> Subject: Re: [PHP-DEV] Windows build >> >> Hi Andi, >> >> Turns out the problem is that Apache is building their binaries using >> VC6 so wrong CRT gets loaded. The only solution I found was >> to tell Windows to load Apache with msvcr80.dll instead of >> msvcr.dll by suppling a manifest file in Apache bin >> directory. If you crate Apache.exe.manifest that contains: >> >> <?xml version='1.0' encoding='UTF-8' standalone='yes'?> >> <assembly xmlns='urn:schemas-microsoft-com:asm.v1' >> manifestVersion='1.0'> >> <dependency> >> <dependentAssembly> >> <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' >> version='8.0.50608.0' processorArchitecture='x86' >> publicKeyToken='1fc8b3b9a1e18e3b' /> >> </dependentAssembly> >> </dependency> >> </assembly> >> >> The Apache will load PHP and PHP will be able to load >> extensions. It probably isn't good idea to force a different >> C Runtime on Apache like this. >> >> Regarding performance, I found that on Zend/bench.php the >> improvement was only marginal (2%) compared to huge increase >> (25-30%) when disabling thread support. >> >> http://edin.dk/archives/25-Benchmarks.html >> >> >> Edin >> >> >> >> Andi Gutmans wrote: >>> Hi Edin, >>> >>> Thanks for trying to get this to work! >>> >>> I think eventually it'll be the right move to go to VC8 but I agree >>> that if it risks a successful 5.2.1 release then it might >> not be worth >>> doing that right now. If you can share with us a >> reproducing case we >>> can try and look into it and see if we can get it to work. >> So far we >>> have concentrated on CLI/CGI/FastCGi because that's the >> most feasible >>> way of running, but I agree that you also need to get the >> other methods to run. >>> >>> For those who are curious, there are some significant performance >>> improvements in VC8. Our tolower() optimization which is >> significant >>> is only for VC8, the compiler creates significantly faster code (on >>> par with Intel C/C++ compiler), and I believe some of the CRT >>> functions like time() are also much faster. So I think it's >> definitely >>> worth upgrading but it should be well timed. >>> >>> Anyway, let us know and we'll try and dig deeper and help get this >>> puppy ported and update the build. There probably is some work that >>> needs to be done on the 3rd party libs. >>> >>> Thanks. >>> >>> Andi >>> >>>> -----Original Message----- >>>> From: Edin Kadribasic [mailto:edin@krug.dk] >>>> Sent: Friday, January 05, 2007 7:48 PM >>>> To: PHP Internals List >>>> Subject: [PHP-DEV] Windows build >>>> >>>> Hey, >>>> >>>> It seems that VC++ 8.0 (Visual Studio 2005) brings more >> trouble that >>>> its worth. Mainly the way it deals with the C runtime. >> After spending >>>> hours and hours of trying to figure out the way to make PHP work >>>> under Apache on Windows and be able to load extensions, >> I'm throwing >>>> in the towel. >>>> >>>> I can get PHP to work fine on the command line, both cgi >> and cli. It >>>> also works fine under IIS using fastcgi. But loading sapi >> dll into a >>>> webserver (not using php.exe or php-cgi.exe) works for the sapi >>>> itself, but trying to load any extensions via php.ini fails >>>> miserably. Sometimes you will get an error that the C runtime was >>>> attempted to be loaded in an illegal way, sometime PHP will claim >>>> that the extension does not exist, etc. >>>> >>>> I looked around at other projects and everyone seems to be >> using VC++ >>>> 6.0 for their builds (Active state, apache, ...) which >> eliminates all >>>> the hassle with bundling C runtime, etc. >>>> >>>> So I think the best thing for us would be to stick to the >> good old C >>>> compiler for making the Windows distro. >>>> >>>> Edin >>>> >>>> -- >>>> PHP Internals - PHP Runtime Development Mailing List To >> unsubscribe, >>>> visit: http://www.php.net/unsub.php >>>> >>> >> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >
Ilia Alshanetsky

Lukas Kahwe Smith

19 years ago
Andi Gutmans wrote:
> Btw, today I never recommend running mod_php on Windows and always point > people to CGI or existing FastCGI implementations.
Well a lot of people develop on windows and deploy on Linux with mod_php. For these people it probably makes more sense using mod_php on windows still. regards, Lukas

Pierre Joye

19 years ago
Hello, On 1/7/07, Lukas Kahwe Smith <mls@pooteeweet.org> wrote:
> Andi Gutmans wrote: > > > Btw, today I never recommend running mod_php on Windows and always point > > people to CGI or existing FastCGI implementations. > > Well a lot of people develop on windows and deploy on Linux with > mod_php. For these people it probably makes more sense using mod_php on > windows still.
As far as I can tell, code "for fcgi" will work on other sapis quite well, that's not always the case for mod_php. It is a good occasion to write (even) more portable apps. --Pierre

Stanislav Malyshev

19 years ago
> Well a lot of people develop on windows and deploy on Linux with > mod_php. For these people it probably makes more sense using mod_php on > windows still.
How it should matter for them - PHP is not supposed to be dependant on SAPI except for maybe some things in environment variables - which would be different on deployment machine anyway?
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

Edin Kadribasic

19 years ago
Stanislav Malyshev wrote:
> How it should matter for them - PHP is not supposed to be dependant on > SAPI except for maybe some things in environment variables - which would > be different on deployment machine anyway?
Not that people should write it like that, but I have seen code in the wild that uses getallheaders() (Apache only function) to get request headers instead of using more portable ways. Edin

Stanislav Malyshev

19 years ago
> Not that people should write it like that, but I have seen code in the > wild that uses getallheaders() (Apache only function) to get request > headers instead of using more portable ways.
Oh, I see. If people use Apache-only functions then surely they have to have Apache :) But since there's a portable alternative available, they have a way to change it.
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

Richard Lynch

19 years ago
On Sun, January 7, 2007 3:34 pm, Stanislav Malyshev wrote:
>> Well a lot of people develop on windows and deploy on Linux with >> mod_php. For these people it probably makes more sense using mod_php >> on >> windows still. > > How it should matter for them - PHP is not supposed to be dependant on > SAPI except for maybe some things in environment variables - which > would > be different on deployment machine anyway?
IIRC, there are 4 things in mod_php that can't be done with CGI, and thus presumably FCGI. [This is my Swiss Cheese memory going back to an exhaustive list I compiled by bugging the crap out of Rasmus back in PHP 3.0 days, so take this whole post with a HUGE grain of salt...] The big one is the HTTP Authentication (?) because, errr, it would have to pass the password in cleartext through a process that would be visible to `ps auxwww` ??? So while it's not technically impossible, it's just verboten in PHP source as a really stupid thing to do. Am I remembering this correctly?... The other 3 are, like, so arcane that only .1% of users even care, as I recall. Some may even be vestigal, like, Hyperwave or somesuch, and could be crossed off the list, if I could find it, in the PHP mailing list archives, from back before the "big split" to PHP-General etc. That said, if my Production environment is mod_php, I want my dev environment to be mod_php, because I'd rather not find out the hard way that it makes some subtle but important difference when I get to QA/staging. If I'm never ever going to be using FCGI in Production, then I really don't want to spend time/money trying FCGI in Development -- And I don't think that's an unrealistic attitude... YMMV
-- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

Stanislav Malyshev

19 years ago
> The big one is the HTTP Authentication (?) because, errr, it would > have to pass the password in cleartext through a process that would be > visible to `ps auxwww` ??? So while it's not technically impossible,
FCGI operates by use of pipes, so any data sent back and forth are not accessible unless you have access to kernel data structures :)
> That said, if my Production environment is mod_php, I want my dev > environment to be mod_php, because I'd rather not find out the hard > way that it makes some subtle but important difference when I get to > QA/staging.
Well, if you develop on Windows and deploy on Linux, you have pretty big difference anyway - much bigger than mod_php/fcgi difference. Of course, if you are using apache-specific functions, then there's no way to do it on fcgi.
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

Ilia A.

19 years ago
On 12-Jan-07, at 4:12 PM, Stanislav Malyshev wrote:
>> That said, if my Production environment is mod_php, I want my dev >> environment to be mod_php, because I'd rather not find out the hard >> way that it makes some subtle but important difference when I get to >> QA/staging. > > Well, if you develop on Windows and deploy on Linux, you have > pretty big difference anyway - much bigger than mod_php/fcgi > difference. Of course, if you are using apache-specific functions, > then there's no way to do it on fcgi.
The $_SERVER vars maybe not quite the same as well when comparing mod_php and fcgi. Ilia Alshanetsky

Stanislav Malyshev

19 years ago
> The $_SERVER vars maybe not quite the same as well when comparing > mod_php and fcgi.
I think the vital ones should be the same, though you indeed might lose some ones like REMOTE_PORT or REMOTE_ADDR - though I checked in my FCGI setup they seem to be ok.
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/

Wez Furlong

19 years ago
Hi Edin, It might be that we need to change our manifest for mod_phpx.dll to make the crt load correctly. IIRC, there was some magical way to do this based on the resource number you use when you bake the manifest into the module; position 1 means one thing and position 2 means another. I have this in one of my makefiles: COOK_EXE_MANIFEST=if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 & del $@.manifest COOK_DLL_MANIFEST=if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2 & del $@.manifest wonder if that's the trick for the php build? (haven't tried it myself on windows in a few weeks). Also note that I don't think the manifest you pasted below forces apache to use a different libc; it should already be linked to the right one based on its filename. This could easily be verified in a debugger by viewing the list of loaded modules--I'd expect to see both the old and the new crt modules in there. --Wez. On 1/6/07, Edin Kadribasic <edin@krug.dk> wrote:

Edin Kadribasic

19 years ago
Hey Wez, We have: _VC_MANIFEST_EMBED_EXE= $(MT) -manifest $@.manifest -outputresource:$@;1 _VC_MANIFEST_EMBED_DLL= $(MT) -manifest $@.manifest -outputresource:$@;2 which should embed the manifest. It works for CLI/CGI but somehow does not work wiht Apache (old CRT). Actually it works for implicit loading apache.exe -> php5apache2.dll -> php5ts.dll. Somehow it does not work when PHP tries to load an extension on startup. Edin Wez Furlong wrote:

Rob Richards

19 years ago
Don't know if any of this will help, but here's what I've been getting while trying to use VS 2005. I'm not sure what the difference is between my debug build and the one Edin released, but when using my own build apache loads everything fine. Using Apache 2.0.59 for testing. When I change the apache config to use the one's Edin released (same php.ini settings other than pointing to the correct extension dirs), I get the issues trying to load pdo dlls. On that note, I also got different results than Edin when trying to run nmake test. Here, everything is failing (only with VS 2005 - everything works fine with VC 6 and VS 2003). After tracing it through everything looks perfectly fine, but when it tries to read the output of a test from the proc_open call, there is no output returned. When I break out the functionality and try to isolate it (using the proc calls, I can get it to work correctly). I am running this on a dual core so wonder if there is any possibility this has any bearing on my issue with nmake test. Rob Edin Kadribasic wrote:

Wez Furlong

19 years ago
Hmm. I know that, in the past, I've had this kind of issue when trying to distribute modules that use the debug version of the CRT (which is itself not redistributable). I wonder if that is sneaking into the build somehow? --Wez. On 1/7/07, Rob Richards <rrichards@ctindustries.net> wrote:

Rob Richards

19 years ago
Not to drag this thread on any longer, but I think I found the issue. There is something wrong with Edin's build. A few of the modules do not have the manifest embedded. I was using bz2 and pdo for testing because I found that both php_bz2.dll and php_pdo.dll have no embedded manifest. When I built a release version myself I checked my extensions and they did have a manifest embedded, so was able to just replace those 2 extensions in Edin's build with the ones mine built and apache loaded them happily. With php_pdo.dll loaded, php_pdo_sqlite.dll (the only acutal db I was testing with) also then loaded fine (already had manifest). I don't know how many other extensions are missing a manifest or even how it happened. As far as CLI vs Apache, I think that CLI works because it loads MSVCR8.dll, so the extensions built incorrectly without an embedded manifest though having a dependancy to MSVCR8.dll (according to dep walker) use the one loaded from the .exe. Apache, not loading MSCVR8.dll or having a notion of it (hence why manually adding an apache manifest works), provides nothing for the bad extensions to key off of and they fail to load not being able to find a reference to MSVCR8.dll. Rob Wez Furlong wrote: