php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18097 conflicting types for `socklen_t' - previous declaration of `socklen_t'
Submitted: 2002-07-01 16:31 UTC Modified: 2004-12-16 12:53 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: marcos at penosaco dot com dot br Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.3.0-dev OS: HP-UX 11.11
Private report: No CVE-ID: None
 [2002-07-01 16:31 UTC] marcos at penosaco dot com dot br
Hi
I'm trying to compile PHP 4.2.1 and i'm getting this: 



Making all in main
        gcc -I. -I/usr/src/php-4.2.1/main -I/usr/src/php-4.2.1/main -I/usr/src/php-4.2.1 -I/usr/src/apache_novo/src/include -I/usr/src/apache_novo/src/os/unix -I/usr/src/php-4.2.1/Zend -I/usr/src/php-4.2.1/ext/mysql/libmysql -I/opt/apache/ora_apa/8.1.7/rdbms/public -I/opt/apache/ora_apa/8.1.7/rdbms/demo -I/usr/src/php-4.2.1/ext/xml/expat  -I/usr/src/php-4.2.1/TSRM -g -O2  -c main.c && touch main.lo
In file included from php_network.h:37,
                 from /usr/src/php-4.2.1/ext/standard/fsock.h:32,
                 from /usr/src/php-4.2.1/ext/standard/php_standard.h:43,
                 from main.c:52:
/usr/include/sys/socket.h:199: conflicting types for `socklen_t'
php.h:114: previous declaration of `socklen_t'
/usr/include/sys/socket.h:484: parse error before "sendfile"
/usr/include/sys/socket.h:484: parse error before "bsize_t"
/usr/include/sys/socket.h:486: parse error before "sendpath"
/usr/include/sys/socket.h:486: parse error before "bsize_t"
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
bmpcpd2:/usr/src/php-4.2.1#


bmpcpd2:/usr/src/php-4.2.1# uname -a
HP-UX bmpcpd2 B.11.11 U 9000/800 1019781745 unlimited-user license

bmpcpd2:/usr/src/php-4.2.1# gcc -v
Reading specs from /usr/local/lib/gcc-lib/hppa1.1-hp-hpux11.00/3.0/specs
Configured with: ../gcc/configure --enable-languages=c,c++ --host=hppa1.1-hp-hpux11.00 --target=hppa1.1-hp-hpux11.00 --with-ld=/usr/ccs/bin/ld --with-gnu-as --enable-libstdcxx-v3
Thread model: single
gcc version 3.0
bmpcpd2:/usr/src/php-4.2.1#


any idea?
Thanks!
Marcos

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-01 17:48 UTC] sniper@php.net
Can you please try this snapshot:

http://snaps.php.net/php4-latest.tar.gz

 [2002-07-01 17:50 UTC] sniper@php.net
Oh, and GCC 3.0 has caused trouble for others..although on different platforms. If that snapshot doesn't work either,
you might wanna try upgrading it to 3.1.

 [2002-07-02 11:24 UTC] marcos at penosaco dot com dot br
Ok... new apache version, new php version (snapshot), new gcc(3.1)

./configure --without-mysql --with-apache=../apache_1.3.26 --with-oci8=/opt/apache/ora_apa/8.1.7 --enable-sigchild --enable-libgcc

(when trying to compile with mysql, i got another compilation error. I don't need mysql for now so i'm trying with '--without-mysql'...)

...
...
...

gcc  -Iext/standard/ -I/usr/src/novos_testes/php4-200207020600/ext/standard/ -DPHP_ATOM_INC -I/usr/src/novos_testes/php4-200207020600/include -I/usr/src/novos_testes/php4-200207020600/main -I/usr/src/novos_testes/php4-200207020600 -I/usr/src/novos_testes/php4-200207020600/Zend -I/opt/apache/ora_apa/8.1.7/rdbms/public -I/opt/apache/ora_apa/8.1.7/rdbms/demo -I/usr/src/novos_testes/php4-200207020600/ext/xml/expat  -I/usr/src/novos_testes/php4-200207020600/TSRM -g -O2  -c /usr/src/novos_testes/php4-200207020600/ext/standard/basic_functions.c -o ext/standard/basic_functions.o  && echo > ext/standard/basic_functions.lo
In file included from /usr/src/novos_testes/php4-200207020600/main/php_network.h:51,
                 from /usr/src/novos_testes/php4-200207020600/ext/standard/fsock.h:30,
                 from /usr/src/novos_testes/php4-200207020600/ext/standard/php_standard.h:43,
                 from /usr/src/novos_testes/php4-200207020600/ext/standard/basic_functions.c:28:
/usr/include/sys/socket.h:199: conflicting types for `socklen_t'
/usr/src/novos_testes/php4-200207020600/main/php.h:131: previous declaration of `socklen_t'
/usr/include/sys/socket.h:484: parse error before "sendfile"
/usr/include/sys/socket.h:485: parse error before "bsize_t"
/usr/include/sys/socket.h:486: parse error before "sendpath"
/usr/include/sys/socket.h:487: parse error before "bsize_t"
gmake: *** [ext/standard/basic_functions.lo] Error 1


bmpcpd2:/usr/src/novos_testes/php4-200207020600# gcc -v
Reading specs from /usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.1/specs
Configured with: ./configure  : (reconfigured) ./configure  : (reconfigured) ./configure
Thread model: posix
gcc version 3.1

bmpcpd2:/usr/src/novos_testes/php4-200207020600#

What I can try now? :(

Thanks!! :)
Marcos
 [2002-07-02 11:27 UTC] marcos at penosaco dot com dot br
Ok... new apache version, new php version (snapshot), new gcc(3.1)

./configure --without-mysql --with-apache=../apache_1.3.26
--with-oci8=/opt/apache/ora_apa/8.1.7 --enable-sigchild --enable-libgcc

(when trying to compile with mysql, i got another compilation error. I
don't need mysql for now so i'm trying with '--without-mysql'...)

...
...
...

gcc  -Iext/standard/
-I/usr/src/novos_testes/php4-200207020600/ext/standard/ -DPHP_ATOM_INC
-I/usr/src/novos_testes/php4-200207020600/include
-I/usr/src/novos_testes/php4-200207020600/main
-I/usr/src/novos_testes/php4-200207020600
-I/usr/src/novos_testes/php4-200207020600/Zend
-I/opt/apache/ora_apa/8.1.7/rdbms/public
-I/opt/apache/ora_apa/8.1.7/rdbms/demo
-I/usr/src/novos_testes/php4-200207020600/ext/xml/expat 
-I/usr/src/novos_testes/php4-200207020600/TSRM -g -O2  -c
/usr/src/novos_testes/php4-200207020600/ext/standard/basic_functions.c
-o ext/standard/basic_functions.o  && echo >
ext/standard/basic_functions.lo
In file included from
/usr/src/novos_testes/php4-200207020600/main/php_network.h:51,
                 from
/usr/src/novos_testes/php4-200207020600/ext/standard/fsock.h:30,
                 from
/usr/src/novos_testes/php4-200207020600/ext/standard/php_standard.h:43,
                 from
/usr/src/novos_testes/php4-200207020600/ext/standard/basic_functions.c:2
8:
/usr/include/sys/socket.h:199: conflicting types for `socklen_t'
/usr/src/novos_testes/php4-200207020600/main/php.h:131: previous
declaration of `socklen_t'
/usr/include/sys/socket.h:484: parse error before "sendfile"
/usr/include/sys/socket.h:485: parse error before "bsize_t"
/usr/include/sys/socket.h:486: parse error before "sendpath"
/usr/include/sys/socket.h:487: parse error before "bsize_t"
gmake: *** [ext/standard/basic_functions.lo] Error 1

bmpcpd2:/usr/src/novos_testes/php4-200207020600# gcc -v
Reading specs from
/usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.1/specs
Configured with: ./configure  : (reconfigured) ./configure  :
(reconfigured) ./configure
Thread model: posix
gcc version 3.1

bmpcpd2:/usr/src/novos_testes/php4-200207020600#

What I can try now? :(

Thanks!! :)
Marcos
 [2002-07-02 11:32 UTC] sniper@php.net
Looks like the test for socklen_t fails in configure.
Check main/php_config.h for HAVE_SOCKLEN_T whether it's
defined or not.

And send me your config.log to sniper@php.net

--Jani

 [2002-07-02 13:48 UTC] marcos at penosaco dot com dot br
email sent
:)
 [2002-07-07 21:26 UTC] sniper@php.net
Please try this snapshot:
(some related stuff was fixed)

http://snaps.php.net/php4-latest.tar.gz

 [2002-07-10 12:47 UTC] robneville73 at hotmail dot com
That latest snapshot also does not seem to solve the problem, I'm on the same versions that marcos is on. Is this stuff for socket support?  Does php really need it or is it only used if I explicitly want to use socket functions?  Can I disable it somehow?  I tried --disable-sockets to no avail.
 [2002-07-10 16:04 UTC] marcos at penosaco dot com dot br
I'm still having trouble to compile too.

I'm having some difficulties to get the error message from the HPUX server (it isn't directly connected to my network and my /dev/fd0 is broken)

I will post the error here ASAP

Marcos
 [2002-07-10 16:12 UTC] robneville73 at hotmail dot com
Actually, whatever was done in snapshot 200207100900 fixed the problem...sort of.  main.c now compiles, but it seems that everything else that includes php_network.h falls over. (i.e. mysql, basic_functions, and some others).  What was done to fix main.c?
 [2002-07-12 13:20 UTC] robneville73 at hotmail dot com
OK... I think I know what the issue is.  Another detail about the OS that I'm assuming is the case with Marcos as well is that he's using the 64-bit version of 11i as I am.  The issue with gcc, not php.  The problem is that the latest gcc was made for 11.0.  gcc has its *own* set of include files that it uses.  So when <sys/socket.h> is included, it's not using the OSes /usr/include/sys but something like /usr/local/lib/gccsomething/blah/include/sys.  The issue is that this file does not contain typedefs for sbsize_t and bsize_t.  If you go to sys/types.h (again gcc's copy) type in typedef int64_t sbsize_t; and then typedef uint64_t bsize_t it should be OK.
 [2002-08-13 22:36 UTC] kalowsky@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.

Okay so marking this closed as it sounds like a gcc bug, and not a PHP bug.  
 [2004-12-16 12:53 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 20:01:33 2025 UTC