Re: Building PHP 5.2.5 for win32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Tyson wrote:
Hiya,

We're using PHP/Java Bridge (PJB) with PHP 5.1.6 and Apache 2.0.61 on Windows, and experiencing frequent segfaults of Apache. Inspecting the dump reveals that PHP is crashing somewhere, something to do with a null pointer exception when reporting an error - seemingly not in the php/java module but elsewhere (although I'm no expert).

I've tried using the same combination but with the latest Apache (2.2.6), but the segfault still happens.

It seems to happen most (and reproducibly) when getting requests through a flex client, when an open connection already exists from a flex client on the same machine (i.e. one browser window runs the flex client, and opens a popup window also with the flex client running).

Firstly, has anyone experienced this?

So, I'm trying to update to the latest version of PHP (5.2.5), but coming up against some problems when attempting to build PHP, which I'm doing in order to build a PJB module to work with it. I've tried to build PHP using Cygwin, cross-compiling against mingw32, but that failed with a number of build errors, presumably related to incompatible libs and includes.

Instead I tried using MS's Visual Studio C++, as in the documentation in the PHP build directory. Firstly I couldn't get the configure script to find the win32build folder, so I added it to PATH and tried again. Then, the configure script ran successfully, but nmake fails with:

    "" -h win32\ -r Release_TS\ -x Release_TS\ win32\build\wsyslog.mc
'-h' is not recognized as an internal or external command, operable program or batch file.
NMAKE : fatal error U1077: '"' : return code '0x1'
Stop.

It would appear that PHP's configure script isn't writing the make rules properly, and is setting an empty string instead of the name of some build tool.

Can anyone help with this? Is there a way of building the PJB module for this version of PHP in win32 that doesn't require a build of PHP itself?

We must have it sorted by next Wednesday (the 19th), and we're willing to pay a reasonable rate for assistance.

Cheers,

Mike

First of all, PHP must be built with MSVC, mingw is not really supported, and cygwin is only supported to run on the cygwin layer (building with mingw is not supported via cygwin)

Secondly, PHP builds fine with all versions of MSVC (even the latest 2008 edition) but setting up the compile environment can be slightly complicated. In addition to the php source code and a version of MSVC, you also need the Windows Platform SDK (included with the full versions of MSVC, but must be installed separately for the express versions).

If you're using VC6 you also must apply the latest service pack and upgrade to the last Windows Platform SDK that supports VC6 (Februrary 2003) and add them to your VC command line environment batch file - in addition you'll need to use the newer nmake.exe from the platform sdk (but not the other compile tools from the SDK - it's easiest to simply rename the old nmake.exe and copy the new one to the same location).

Then you need all the libraries that PHP currently requires. They can be found at http://files.edin.dk/php/win32/zip.zip - yes I know, original name. Caution, this is a large download because it contains not only the standard libraries needed but also any libraries used for PECL extensions. The zip archive pointed to in the manual is supposed to have just the core libraries required but is sadly out of date.

Unzip the resulting files and place them parallel to your php source code - it'll look for the php_build and template directories - you can put them elsewhere but then you have to mess with configure flags, it's easier just to put them in the automatically detected location.

Once you have a compile environment set up, the source code available, and the required zip.zip files you can open up a visual studio command prompt and cd into your php source code, and run your configure.

Currently there is no way to do the equivalent of "phpize" on nix on a windows system to build just one extension against an existing php and libs. This is something I have on my "list of things to do" but time and energy is scarce. You can set up a makefile by hand if you really know what you're doing. Just make sure to link against the right PHP lib and provide the preprocessor defines needed.

I also provide PHP builds in several compilers in several formats at perisama.net if you're looking for debug versions of PHP - if you have more questions feel free to ask.

Thanks,
Elizabeth Smith

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux