Operating System - HP-UX
1831670 Members
2020 Online
110029 Solutions
New Discussion

Re: PHP compilation error on HP-UX11 64bit

 
infolt
Occasional Advisor

PHP compilation error on HP-UX11 64bit

Hello, compiling php 4.2.1 (same error was with original 4.0.4) on HP-UX 11 64-bit with Apache 1.3.19
installed, I receive the following error
-------------------------------------------------------------------------
Making all in main
gcc -I. -I/ora04/php-4.2.1/main -I/ora04/php-4.2.1/main -I/ora04/php-4.2.1 -
I/ora04/php-4.2.1/Zend -I/ora04/php-4.2.1/ext/mysql/libm
ysql -I/ora04/php-4.2.1/ext/xml/expat -I/ora04/php-4.2.1/TSRM -g -O2 -c
main.c && touch main.lo
In file included from php_network.h:37,
from /ora04/php-4.2.1/ext/standard/fsock.h:32,
from /ora04/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.

-----------------------------------------------------------

Has anyone experienced the same error? It looks like same environment
variable definition differs...

Any help will be appreciated.

Thank you.
11 REPLIES 11
Stefan Farrelly
Honored Contributor

Re: PHP compilation error on HP-UX11 64bit


I will try compiling on a server here (with various compilers) but I cant find it - where did you download php 4.2.1 from ?
Im from Palmerston North, New Zealand, but somehow ended up in London...
RikTytgat
Honored Contributor

Re: PHP compilation error on HP-UX11 64bit

Hi,

I had exactly the same error when trying to compile perl modules with gcc.

The core of the problem is that gcc is not supported on HPUX 11i (www.gnu.org). But, there is a workaround:

http://gcc.gnu.org/ml/gcc-bugs/2001-09/msg00139.html

Try solution 2 (the one thqt solved my problem).


Hope this helps,
Rik
infolt
Occasional Advisor

Re: PHP compilation error on HP-UX11 64bit

Thank you for your responses. After adding the mentioned lines, I receive the following error

In file included from php_network.h:37,
from /ora04/php-4.2.1/ext/standard/fsock.h:32,
from /ora04/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'
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
RikTytgat
Honored Contributor

Re: PHP compilation error on HP-UX11 64bit

Hi,

Could you try to add the compile flag _HPUX_SOURCE?

As is
gcc .... -D_HPUX_SOURCE ...

Bye,
Rik
infolt
Occasional Advisor

Re: PHP compilation error on HP-UX11 64bit

I believe it used it: heres part of compilation

/bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../main -DHPUX11 -DMOD_SSL=208103 -D
MOD_PERL -DUSE_PERL_SSI -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -DUINT32_MAX_BROKEN -D_LARGEFILE_SOURCE -D_FILE_OFFSET_
BITS=64 -DUSE_HSREGEX -DEAPI -DEAPI_MM -DUSE_EXPAT -DCHROOT -I../TSRM -g -O2 -prefer-pic -c -o zend_constants.lo `test
-f zend_constants.c || echo './'`zend_constants.c


Unless Im totally off-track...

Do you have any other thoughts?

Thank you.

BTW, php 4.2.1 is from php.net
benoit Bruckert
Honored Contributor

Re: PHP compilation error on HP-UX11 64bit

Hello,
On my side it works, my config is :
apache 1.3.19, php 4.2.1, compile with gcc 2.95.2,
OS is HPUX11.00, 64 bit,
options for configure are :
./configure --with-oci8=... --with-mysql=....
--with-apache=... --enable-track-vars --with-gd=/opt/gd --with-jpeg-dir=/opt/jpeg --with-ldap=...

I compiled php in static mode..
few warnings, but compilation is OK and it works...
Une application mal pansée aboutit à une usine à gaze (GHG)
infolt
Occasional Advisor

Re: PHP compilation error on HP-UX11 64bit

Hello, Im afraid hp-ux version is the problem: we have 11i with gcc 3.0.4 (just doesnt work!)

I have also found links saying that gcc dont compile well on 11i. Now trying to install newer version of gcc - 3.1, hope this helps.

Keep u posted. Thank you.
infolt
Occasional Advisor

Re: PHP compilation error on HP-UX11 64bit

Nope, didnt help. Same error:
/usr/include/sys/socket.h:199: conflicting types for `socklen_t'
php.h:114: previous declaration of `socklen_t'.

Does anyone has compiled version with oci8 and oracle?

Thanks.
benoit Bruckert
Honored Contributor

Re: PHP compilation error on HP-UX11 64bit

I did it with oci8, as I described before.
Can you try with an older gcc if gcc is the problem.
In theory, there's a binary compatibility with older version.
Of course you'll not use features of the 64 bits (direct access to high memory). But to use it you need to make your own programs ! I'm not sure you want to create your own php version for 64 bits.
If you want I can compile a version of httpd for you just to check if it's work on your environnement. All what I need are the options PHP and apache (path and so on). I used to do it between 64 bit and 32 bit hosts and it works.
warning, httpd binary is about 8 Mbyte !
Une application mal pansée aboutit à une usine à gaze (GHG)
infolt
Occasional Advisor

Re: PHP compilation error on HP-UX11 64bit

That would be GREAT if u try to compile it! I've spent the last two days playing with it, and now Im almost on the edge! ;-)

config as follows:
--with-apxs=/opt/apache/bin/apxs --enable-track-vars
--with-oci8=/oracle/product/8.1.7
--with-oracle=/oracle/product/8.1.7 --enable-sigchild

would greatly appreciate it!

BTW, 8Mb is not a problem - we've put 15Mb limit! dima@klasco.lt is the email. THANK U!
benoit Bruckert
Honored Contributor

Re: PHP compilation error on HP-UX11 64bit

A long answer due to a long W.E. !
Hope it's not to late and you are still alive !
I never succeded to compile with apxs, then I created a static mode with APache.
I changed in fact --with-apxs with --with_apache=, in your request.
Options I used to create httpd are :
./configure "--with-layout=Apache" "--prefix=/home/http" "--sysconfdir=/home/http/etc" "--disable-module=all" "--enable-module=so" "--activate-module=src/modules/php4/libphp4.a"
Don't forget to copy php.ini in /usr/local/lib and place the good options.
I didn't try entirely the httpd because my filesystems aren't the same as yours. but httpd -l and httpd-v works !.
Don't forget also to configure your httpd.conf .
I send to your address the httpd file !
Une application mal pansée aboutit à une usine à gaze (GHG)