FAQ
Hello

I'm having compile issues with PHP5 on Solaris. I tried both Solaris 8
and 9, both giving me the same error. The problem is in the file
ext/standard/proc_open.c

And the error message from gcc is:

In file included from
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend.h:244, from
/Home/staff/fahlgren/php-test/php5-200405071030/main/php.h:34, from
/Home/staff/fahlgren/php-test/php5-200405071030/ext/standard/proc_open.c:23:
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
parse error before `*'
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
parse error before `uint'
/Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
`ulong' declared as function returning a function
[...] more errors due to the first ones.

I found that in order to get ulong and uint on Solaris you have to
include sys/types.h Then it compiles and gives a functional binary. It
must beincluded before the "#define _XOPEN_SOURCE", otherwise it still
won't compile.

This problem is still in the latest cvs snapshot (from May 07, 2004
10:30 GMT as you can tell by the path). When I compiled RC2 I think I
had to include sys/termios.h as well in order to get some constant
defined, but that seems to have been fixed now.

/ Daniel Fahlgren

--
I live the way I type; fast, with a lot of mistakes

Daniel Fahlgren http://www.acc.umu.se/~guru/
sysadm@{acc,cs,math}.umu.se 070-3406400 ordf@acc

Search Discussions

  • Wez Furlong at May 7, 2004 at 1:00 pm
    This is a known issue (search bugs.php.net).

    Unfortunately, the workaround you (and the others) suggest will cause a
    similar problem on Linux systems :-/

    We need to find a way to set those _XOPEN_SOURCE style defines up so that
    the build succeeds on your system. However, I don't have access to any
    Solaris boxen so I can't get stuck in to fix it.

    --Wez.

    -----Original Message-----
    From: Daniel Fahlgren
    Sent: 07 May 2004 12:58
    To: internals@lists.php.net
    Subject: [PHP-DEV] compile issues on Solaris

    Hello

    I'm having compile issues with PHP5 on Solaris. I tried both
    Solaris 8 and 9, both giving me the same error. The problem
    is in the file ext/standard/proc_open.c

    And the error message from gcc is:

    In file included from
    /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend.h:24
    4, from
    /Home/staff/fahlgren/php-test/php5-200405071030/main/php.h:34, from
    /Home/staff/fahlgren/php-test/php5-200405071030/ext/standard/p
    roc_open.c:23:
    /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
    parse error before `*'
    /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
    parse error before `uint'
    /Home/staff/fahlgren/php-test/php5-200405071030/Zend/zend_hash.h:39:
    `ulong' declared as function returning a function [...] more
    errors due to the first ones.

    I found that in order to get ulong and uint on Solaris you
    have to include sys/types.h Then it compiles and gives a
    functional binary. It must beincluded before the "#define
    _XOPEN_SOURCE", otherwise it still won't compile.

    This problem is still in the latest cvs snapshot (from May
    07, 2004 10:30 GMT as you can tell by the path). When I
    compiled RC2 I think I had to include sys/termios.h as well
    in order to get some constant defined, but that seems to have
    been fixed now.

    / Daniel Fahlgren

    --
    I live the way I type; fast, with a lot of mistakes

    Daniel Fahlgren http://www.acc.umu.se/~guru/
    sysadm@{acc,cs,math}.umu.se 070-3406400 ordf@acc

    --
    PHP Internals - PHP Runtime Development Mailing List To
    unsubscribe, visit: http://www.php.net/unsub.php
  • Daniel Fahlgren at May 7, 2004 at 6:59 pm

    On Fri, May 07, 2004 at 02:00:31PM +0100, Wez Furlong wrote:
    This is a known issue (search bugs.php.net).

    Unfortunately, the workaround you (and the others) suggest will cause a
    similar problem on Linux systems :-/

    We need to find a way to set those _XOPEN_SOURCE style defines up so that
    the build succeeds on your system. However, I don't have access to any
    Solaris boxen so I can't get stuck in to fix it.
    Well. A simple solution that should keep the build on Linux (and others)
    intact is

    #ifdef __sun__
    #include<sys/types.h>
    #endif

    Perhaps not the neatest one, but then it should compile on Solaris using
    gcc.. Better then not compile at all :) I guess the correct way is to
    let configure figure out if types.h is needed and not trust a define
    that might not exist in all compilers.

    I could dig in and try to find another solution that works. If I'm
    feeling brave (and perhaps stupid) I can give it a try on Irix and AIX
    as well.. ;) (I haven't tried to compile on them at all)

    / Daniel Fahlgren

    --
    I live the way I type; fast, with a lot of mistakes

    Daniel Fahlgren http://www.acc.umu.se/~guru/
    sysadm@{acc,cs,math}.umu.se 070-3406400 ordf@acc
  • Wez Furlong at May 7, 2004 at 7:13 pm

    Well. A simple solution that should keep the build on Linux
    (and others)
    intact is

    #ifdef __sun__
    #include<sys/types.h>
    #endif

    Perhaps not the neatest one, but then it should compile on
    Solaris using
    gcc.. Better then not compile at all :)
    Better to do it the right way, which is why I haven't committed a
    workaround; sooner or later someone is going to find the right way to do
    it ;-)
    I guess the correct way is to
    let configure figure out if types.h is needed and not trust a define
    that might not exist in all compilers.
    That won't work so easily as you might hope, because our configure
    generated header stuff pulls in system headers, and we need to define
    those magic _XOPEN_SOURCE defines before the system headers come in.
    Nice bit of chicken and egg for us :)

    It probably is possible, but it's a lot more work than just poking
    around in the header files on the systems where it breaks and finding
    out just what we're supposed to be doing.
    I could dig in and try to find another solution that works. If I'm
    feeling brave (and perhaps stupid) I can give it a try on Irix and AIX
    as well.. ;) (I haven't tried to compile on them at all)
    Any help would be appreciated; essentially you need to find a way to get
    ulong defined with the _XOPEN_SOURCE and _BSD_SOURCE symbols defined.

    You might find that you need to specify a numeric value (the year or
    revision number; I don't recall) for it to turn on certain parts of the
    header.

    Something like this:

    #define _XOPEN_SOURCE 0x1000

    Thanks for any insight you can provide on this,

    --Wez.
  • Daniel Fahlgren at May 7, 2004 at 8:34 pm

    On Fri, May 07, 2004 at 08:12:54PM +0100, Wez Furlong wrote:
    Any help would be appreciated; essentially you need to find a way to get
    ulong defined with the _XOPEN_SOURCE and _BSD_SOURCE symbols defined.

    You might find that you need to specify a numeric value (the year or
    revision number; I don't recall) for it to turn on certain parts of the
    header.

    Something like this:

    #define _XOPEN_SOURCE 0x1000

    Thanks for any insight you can provide on this,
    Oki, second attempt. Perhaps att better solution:

    #define _XOPEN_SOURCE
    #define _BSD_SOURCE

    #define __EXTENSIONS__
    #include <sys/types.h>

    #include "php.h"
    #include <stdio.h>
    #include <ctype.h>
    [...]

    compiles on both Solaris and Linux. (at least when I try it at home) :)
    I have only tried it on Solaris 8 and 9 since I don't have access to any
    other versions.

    I have also found some problems with iconv on Solaris (and it fails make
    test as well), will try to track it down and find the problem during the
    weekend.

    / Fahlgren
  • Wez Furlong at May 7, 2004 at 8:44 pm

    Oki, second attempt. Perhaps att better solution:

    #define _XOPEN_SOURCE
    #define _BSD_SOURCE

    #define __EXTENSIONS__
    #include <sys/types.h>

    #include "php.h"
    #include <stdio.h>
    #include <ctype.h>
    [...]

    compiles on both Solaris and Linux. (at least when I try it
    at home) :)
    I have only tried it on Solaris 8 and 9 since I don't have
    access to any
    other versions.
    Great - that "looks" right. Thanks :)

    I think that we just need to solve this problem for OpenBSD too (iirc).

    I don't have any OpenBSD boxen, so it would be great if someone lurking
    here could test/investigate this too.
    I have also found some problems with iconv on Solaris (and it
    fails make
    test as well), will try to track it down and find the problem
    during the
    weekend.
    I think the best results for the iconv extension can be obtained using
    the GNU libiconv implementation, but I'm no expert on this.

    --Wez.
  • Jay Smith at May 7, 2004 at 7:34 pm

    Wez Furlong wrote:

    This is a known issue (search bugs.php.net).

    Unfortunately, the workaround you (and the others) suggest will cause a
    similar problem on Linux systems :-/

    We need to find a way to set those _XOPEN_SOURCE style defines up so that
    the build succeeds on your system. However, I don't have access to any
    Solaris boxen so I can't get stuck in to fix it.

    --Wez.
    <snip>

    Hey Wez,

    Conincidentally enough, just yesterday I ressurrected my Solaris box, so if
    you'd like a login or have any tests you'd like me to, I can provide a
    login and everything. Actually, I think I sent login details a long time
    ago, but if not, I can re-send 'em.

    The box is still at Solaris 8 on an old SPARC Ultra 10. I've upgraded a few
    things recently like glibc and gcc and such, and while it's a bit of hassle
    to compile PHP now (ld path issues, I think I've cleaned most of it up) it
    will probably do if you need a shell.

    Let me know and I'll send you the login details if want access.

    J
  • Wez Furlong at May 7, 2004 at 7:48 pm
    Hey Jay,

    That would be great; I tried to reach the box when I discovered the bug,
    but it wasn't there :-)

    If the login and port are still the same, I'll try it over the weekend.

    Thanks,

    --Wez.
    Hey Wez,

    Conincidentally enough, just yesterday I ressurrected my
    Solaris box, so if
    you'd like a login or have any tests you'd like me to, I can provide a
    login and everything. Actually, I think I sent login details
    a long time
    ago, but if not, I can re-send 'em.

    The box is still at Solaris 8 on an old SPARC Ultra 10. I've
    upgraded a few
    things recently like glibc and gcc and such, and while it's a
    bit of hassle
    to compile PHP now (ld path issues, I think I've cleaned most
    of it up) it
    will probably do if you need a shell.

    Let me know and I'll send you the login details if want access.

    J

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php
  • Uwe Schindler at May 7, 2004 at 8:01 pm
    I have Solaris 9 X86 in a VMWARE and a Solaris 9 Sparc Server... Could help
    with this.
    At 21:48 07.05.2004, Wez Furlong wrote:

    Hey Jay,

    That would be great; I tried to reach the box when I discovered the bug,
    but it wasn't there :-)

    If the login and port are still the same, I'll try it over the weekend.

    Thanks,

    --Wez.
    Hey Wez,

    Conincidentally enough, just yesterday I ressurrected my
    Solaris box, so if
    you'd like a login or have any tests you'd like me to, I can provide a
    login and everything. Actually, I think I sent login details
    a long time
    ago, but if not, I can re-send 'em.

    The box is still at Solaris 8 on an old SPARC Ultra 10. I've
    upgraded a few
    things recently like glibc and gcc and such, and while it's a
    bit of hassle
    to compile PHP now (ld path issues, I think I've cleaned most
    of it up) it
    will probably do if you need a shell.

    Let me know and I'll send you the login details if want access.

    J

    --
    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
    -----
    Uwe Schindler
    Addr 1: Bamberger Str. 24a, D-96049 Bamberg
    Addr 2: Drausnickstr. 153, D-91052 Erlangen
    http://www.thetaphi.de - http://www.schindlers-software.de
    eMails: uwe@thetaphi.de (private); info@schindlers-software.de (company)
    Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)

    Schindlers Software - Home of Schindlers PC-LATEIN 3.10
    DIE Software zum Lateinlernen!
  • Jay Smith at May 7, 2004 at 8:19 pm

    Wez Furlong wrote:


    Hey Jay,

    That would be great; I tried to reach the box when I discovered the bug,
    but it wasn't there :-)

    If the login and port are still the same, I'll try it over the weekend.

    Thanks,

    --Wez.
    Everything should be as it was before. That box went down a couple of months
    ago and I kind of forgot about it since it's only really used for a bit of
    testing. We had a meeting yesterday and it was brought up, so I figured I
    should probably make sure that the box was at least working in some form.
    It's kind of a waste to just have it sitting there; as slow as it is, it's
    still a decent enough box. Those old Solaris boxes, no matter how slow they
    seem to be, they can still stand up to pretty much anything and are
    practically indestructable.

    Anyways, if there's any problems, let me know and I'll see what I can do.

    J

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedMay 7, '04 at 11:58a
activeMay 7, '04 at 8:44p
posts10
users4
websitephp.net

People

Translate

site design / logo © 2022 Grokbase