LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 01-09-2015, 03:36 AM   #1
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
PHP-5.6.4 compilation: how to define struct flock


Tried to compile PHP-5.6.4, but got error message:
Code:
checking "whether flock struct is linux ordered"... "no"
checking "whether flock struct is BSD ordered"... "no"
configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
in linux, 'struct flock' comes from fcntl.h, it's something like this (with large-file-support):
Code:
struct flock
  {
    short int l_type;
    short int l_whence;
    __off64_t l_start;
    __off64_t l_len;
    __pid_t l_pid;
  };
In AIX, 'struct flock' lives in flock.h, it's something like this:
Code:
struct flock {
 short l_type;
 short l_whence;
 unsigned int l_sysid;
 pid_t l_pid;
 int l_vfs;
 off_t l_start;
 off_t l_len;
};
And here is what PHP came up with:
Code:
#include <fcntl.h>

struct flock lock = { 1, 2, 3, 4, 5 };

int main() {
    if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
        return 0;
    }
    return 1;
}
The only comment I can come up with is: *sigh*

Later: --enable-opcache=no solved this problem. Next one:
Code:
/usr/local/src/php-5.6.4/ext/oci8/oci8.c: In function 'php_oci_connection_ping':
/usr/local/src/php-5.6.4/ext/oci8/oci8.c:2224:2: error: 'version' undeclared (first use in this function)

Last edited by NevemTeve; 01-09-2015 at 04:04 AM.
 
Old 01-09-2015, 04:26 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
It was because of the old Oracle version... Now I'm trying this:

Code:
if explist $ORACLE_HOME/lib32/libclntsh.so | grep -q OCIPing; then
    echo Happy
else
    echo '*** Except troubles with OCIPing ***'
fi
That helped. Now my only concern is these warnings from ld (when linking sapo/cli/php):
Code:
ld: 0711-415 WARNING: Symbol HARDCODED_INI is already exported.
...
ld: 0711-415 WARNING: Symbol zval_used_for_init is already exported.

Last edited by NevemTeve; 01-10-2015 at 01:43 PM. Reason: missing 'quotes'
 
Old 01-09-2015, 05:25 AM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
Ok, I found the reason: ld was been given two export files: one generated by libtool (because of option -export-dynamic) and one generated by PHP's compilation scripts.
 
Old 01-09-2015, 06:26 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
And now:
Code:
It is not safe to rely on the system's timezone settings.
You are *required* to use the date.timezone setting or the 
date_default_timezone_set() function. 
In case you used any of those methods and you are still getting this warning,
you most likely misspelled the timezone identifier.
of course it worked in the previous version. /usr/local/etc/php.ini:
Code:
[Date]
; Defines the default timezone used by the date functions
; 20090403.LZS: új érték: Europe/Budapest
date.timezone = Europe/Budapest
Edit: the message comes from php_date.c name's DATE_TZ_ERRMSG

Last edited by NevemTeve; 01-09-2015 at 06:30 AM.
 
Old 01-09-2015, 06:51 AM   #5
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
function parse_tz.c:seek_to_tz_position tries to find "Europe/Budapest" in ints database. I think it should work:
Code:
p tzdb->index[424]
$18 = {id = 0x107cc554 <empty_fcall_info_cache+7456> "Europe/Budapest", pos = 182008}
 
Old 01-09-2015, 07:06 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
Recompiled with option '-g', now works. So now I recompile it again without '-g' and see what happens.

Now it works. Next step: repeat it on another computer.

20150109.1509: On the second computer ./configure failed when it couldn't find libreadline.a's dependency libcurses.a... solution:
Code:
sed 's;termcap;curses;g' configure

Last edited by NevemTeve; 01-09-2015 at 08:12 AM.
 
Old 01-09-2015, 08:48 AM   #7
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
20150109.1540: Got back to the first computer, compiled PHP again, result: from CLI works, from Apache doesn't work. Also it cannot load the plugins (imagick and a home-made plugin).

20150109.1735: Well, if was my fault: I didn't add configure option --with-layout=GNU so it took the ini-file from some exotic place instead of /usr/local/etc/php.ini

Last edited by NevemTeve; 01-11-2015 at 04:22 AM.
 
Old 01-09-2015, 10:58 AM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
Note: in the version the default value of default_charset is 'UTF-8', not empty as it used to be!

Last edited by NevemTeve; 01-09-2015 at 10:59 AM.
 
Old 01-10-2015, 02:26 PM   #9
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,075

Original Poster
Rep: Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475Reputation: 1475
Another computer with older AIX, linking libphp5.so:
Code:
ld: 0711-317 ERROR: Undefined symbol: .CMSG_SPACE
ld: 0711-317 ERROR: Undefined symbol: .CMSG_LEN
20150110.2141: So it should come from sys/sockets.h, but not always...
I could either define symbol _LINUX_SOURCE_COMPAT or hack a special little file called /usr/local/include/sys/socket.h... I think I'll go for the second option.

20150111.1120: It's something like this:
Code:
/* socket.h */

#ifndef _H_SYS_SOCKET

/* install this file into  /usr/local/include/sys */

#include_next <sys/socket.h>

#ifndef CMSG_ALIGN
#define CMSG_ALIGN _CMSG_ALIGN
#define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
#define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
#endif

#endif
Hopefully, it won't cause trouble in any AIX version

Last edited by NevemTeve; 01-11-2015 at 04:21 AM.
 
  


Reply

Tags
aix, flock, php


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Docker, FESCo Election, Android App for Flock, Flock Video Volunteers, and Release Naming (5tF LXer Syndicated Linux News 0 07-17-2014 05:30 PM
How to define the Memory sections in GCC during compilation rktech83 Programming 1 06-14-2006 11:33 AM
How to define the Memory sections in GCC during compilation rktech83 Programming 2 06-14-2006 08:30 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 02:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration