FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Compiling PHP 5.x on Cygwin
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Compiling PHP 5.x on Cygwin [message #182637 is a reply to message #182588] Tue, 20 August 2013 18:20 Go to previous messageGo to previous message
Christoph Michael Bec is currently offline  Christoph Michael Bec
Messages: 207
Registered: June 2013
Karma:
Senior Member
Jerry Stuckle wrote:

> On 8/16/2013 6:16 PM, Christoph Michael Becker wrote:
>> I have tried to compile PHP 5.5.1 and 5.5.2 on Cygwin[1], but the
>> default ./configure fails with:
>>
>> | checking for known struct flock definition... configure: error: Don't
>> | know how to define struct flock on this system, set
>> | --enable-opcache=no
>>
>> If I do "./config --enable-opcache=no" I'm able to build PHP, but I'd
>> rather build it with the opcache enabled. Any hints on how to
>> accomplish this are appreciated.
>>
>> [1] $ uname -a
>> CYGWIN_NT-5.1 RELIANT 1.7.18(0.263/5/3) 2013-04-19 10:39 i686 Cygwin
>>
>
> I suspect it's looking for struct flock in .../include/sys/fcntl.h.
> However, IIRC, in cygwin the definition is located in
> .../cygwin/include/cygwin/types.h. But beware - the last I looked,
> flock was still buggy in cygwin.
>
> I don't use cygwin here any more, so I can't test. However, I suspect
> you're going to have to modify your config file or, at the very least,
> force an include of the cygwin version of the file. You may also have
> to look into the header to see if you need a #define to get the struct
> included.

Thanks, Jerry, that brought me a bit further. Indeed including
<cygwin/types.h> in the config file made the general check for flock
happy; the second check for the opcache additionally needed a ||
defined(__CYGWIN32__) to an #elif. After these modifications building
was possible; however, I was not able to actually activate the opcache.

The problem seems to be that PHP is building shared libraries with a .so
extension on Cygwin, where this should be .dll.a. This also happens
with the original ./configure and --enable-opcache=no. This is no
problem for the PHP executable, which statically links in the default
extensions, but not the opcache extension.

Running "make test" produced failures for all tests, which might be
related to the shared library issue. It seems to me PHP's Cygwin
support has some flaws. I'm considering to file a bug report/feature
request to improve that, even if I understand that supporting Cygwin has
probably low priority for the PHP developers.

> But why try to get PHP working in cygwin? The Windows version of PHP
> works fine (as does Apache). Or, if you need Linux, load a real Linux
> distro (I use Debian but Ubuntu is also good, I hear) in a virtual box
> under Windows.

I'm still stuck with Windows XP (I know, I should have already
upgraded), so I can't run the native Windows build of PHP 5.5. But even
after upgrading I would prefer being able to compile PHP in a Unix like
environment. I would prefer using Cygwin over a virtual machine
installation of a Linux system, as it is more lightweight and may
suffice for my purposes.

--
Christoph M. Becker
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: switch with case 0
Next Topic: Re: korean character sets
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Oct 18 16:13:29 GMT 2024

Total time taken to generate the page: 0.05195 seconds