php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37462 install fails for sapi/cgi/php
Submitted: 2006-05-16 15:37 UTC Modified: 2007-04-02 22:12 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:3 (75.0%)
From: ionut dot aivanesei at amdocs dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.2.0 OS: AIX 5.3
Private report: No CVE-ID: None
 [2006-05-16 15:37 UTC] ionut dot aivanesei at amdocs dot com
Description:
------------
Hi,

I am trying to install PHP 5.1.x on AIX server.
Configure fails with this:

--------------------------------------------------
...
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.
--------------------------------------------------

My system is: [uname -a] AIX ep5703 3 5 00CC62EA4C00

Thanks,
Ionutz


Reproduce code:
---------------
#! /bin/sh
#
# Created by configure

'./configure' \
'--prefix=[...]/php' \
'--with-mysql=[...]/mysql' \
'--with-libxml-dir=[...]/libxml2' \
'--with-zlib=[...]/zlib' \
'--enable-force-cgi-redirect' \
'--enable-exif' \
'--enable-ftp' \
"$@"


Expected result:
----------------
no error

Actual result:
--------------
configure:59182: checking for mysql_close in -lmysqlclient
configure:59201: cc -o conftest -I/usr/include -g  -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/mysql/lib -L/sviuser21.e
p5703/crm/svi/eddys/MATRIX/mysql/lib -L/usr/lib  -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/libxml2/lib -L/sviuser21.e
p5703/crm/svi/eddys/MATRIX/libxml2/lib -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib/lib -L/sviuser21.ep5703/crm/svi
/eddys/MATRIX/zlib/lib conftest.c -lmysqlclient  -liconv -lz -lm  -lxml2 -lm -lxml2 -lm 1>&5
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/mysql/lib flag is ignored.
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/libxml2/lib flag is ignored.
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib/lib flag is ignored.
ld: 0711-317 ERROR: Undefined symbol: .mysql_close
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
configure: failed program was:
#line 59190 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_close();

int main() {
mysql_close()
; return 0; }
configure:59422: checking for mysql_error in -lmysqlclient
configure:59441: cc -o conftest -I/usr/include -g  -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/mysql/lib -L/sviuser21.e
p5703/crm/svi/eddys/MATRIX/mysql/lib -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib/lib -L/sviuser21.ep5703/crm/svi/e
ddys/MATRIX/zlib/lib -L/usr/lib  -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/libxml2/lib -L/sviuser21.ep5703/crm/svi/ed
dys/MATRIX/libxml2/lib -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib/lib -L/sviuser21.ep5703/crm/svi/eddys/MATRIX/zl
ib/lib -R/sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib -L/sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib conftest.c -lmysq
lclient  -lz -liconv -lz -lm  -lxml2 -lm -lxml2 -lm 1>&5
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/mysql/lib flag is ignored.
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib/lib flag is ignored.
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/libxml2/lib flag is ignored.
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib/lib flag is ignored.
ld: 0706-027 The -R /sviuser21.ep5703/crm/svi/eddys/MATRIX/zlib flag is ignored.
ld: 0711-317 ERROR: Undefined symbol: .mysql_error
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
configure: failed program was:
#line 59430 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_error();

int main() {
mysql_error()
; return 0; }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-17 06:01 UTC] ionut dot aivanesei at amdocs dot com
Hi,

Indeed it was a problem with the MySQL binaries, they were for 64 instead for 32.

After changing MySQL binaries 'configure' and 'make' are executed without errors.
But, when I execute 'make install' i get the following:

--------------------------------------------------
Installing PHP SAPI module:       cgi
Installing PHP CGI into: [...]/php/bin/
cp: sapi/cgi/php: A file or directory in the path name does not exist.
make: 1254-004 The error code from the last command is 1.
--------------------------------------------------

File sapi/cgi/php indeed does not exists.

Thanks,
Ionutz
 [2006-05-17 08:06 UTC] ionut dot aivanesei at amdocs dot com
I think something is wrong with the Makefile generated by configure. I will show you some line where is defined BUILD_CLI and BUILD_CGI (both were not compiled):

----------------------------------------
...
SAPI_CLI_PATH = sapi/cli/php
BUILD_CLI = echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg `echo $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'` | $(AWK) '{ if ((($$2 == "T") || ($$2 == "D") || ($$2 == "B")) && (substr($$3,1,1) != ".")) { print $$3 } }' | sort -u >> php.sym && $(LIBTOOL) --mode=link $(CC) -export-dynamic $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS_PROGRAM) $(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_CLI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $(SAPI_CLI_PATH)INSTALL_CLI = $(mkinstalldirs) $(INSTALL_ROOT)$(bindir); $(INSTALL) -m 0755 $(SAPI_CLI_PATH) $(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)
SAPI_CGI_PATH = sapi/cgi/php
BUILD_CGI = echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg `echo $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'` | $(AWK) '{ if ((($$2 == "T") || ($$2 == "D") || ($$2 == "B")) && (substr($$3,1,1) != ".")) { print $$3 } }' | sort -u >> php.sym && $(LIBTOOL) --mode=link $(CC) -export-dynamic $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS_PROGRAM) $(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $(SAPI_CGI_PATH)
...
----------------------------------------

And also some strange line in the end of the 'make' command:

----------------------------------------
...
        /bin/sh [...]/_sources/php/php-5.1.2/libtool --silent --preserve-dup-deps --mode=compile cc  -Isapi/cgi/ -I[...]/_sources/php/php-5.1.2/sapi/cgi/ -DPHP_ATOM_INC -I[...]/_sources/php/php-5.1.2/include -I[...]/_sources/php/php-5.1.2/main -I[...]/_sources/php/php-5.1.2 -I[...]/libxml2/include/libxml2 -I[...]/_sources/php/php-5.1.2/ext/date/lib -I[...]/_sources/php/php-5.1.2/TSRM -I[...]/_sources/php/php-5.1.2/Zend    -I/usr/include -g  -c [...]/_sources/php/php-5.1.2/sapi/cgi/getopt.c -o sapi/cgi/getopt.lo
        /bin/sh [...]/_sources/php/php-5.1.2/libtool --silent --preserve-dup-deps --mode=compile cc  -Imain/ -I[...]/_sources/php/php-5.1.2/main/ -DPHP_ATOM_INC -I[...]/_sources/php/php-5.1.2/include -I[...]/_sources/php/php-5.1.2/main -I[...]/_sources/php/php-5.1.2 -I[...]/libxml2/include/libxml2 -I[...]/_sources/php/php-5.1.2/ext/date/lib -I[...]/_sources/php/php-5.1.2/TSRM -I[...]/_sources/php/php-5.1.2/Zend    -I/usr/include -g  -c main/internal_functions.c -o main/internal_functions.lo
        echo '\
\
        /bin/sh [...]/_sources/php/php-5.1.2/libtool --silent --preserve-dup-deps --mode=compile cc  -Isapi/cli/ -I[...]/_sources/php/php-5.1.2/sapi/cli/ -DPHP_ATOM_INC -I[...]/_sources/php/php-5.1.2/include -I[...]/_sources/php/php-5.1.2/main -I[...]/_sources/php/php-5.1.2 -I[...]/libxml2/include/libxml2 -I[...]/_sources/php/php-5.1.2/ext/date/lib -I[...]/_sources/php/php-5.1.2/TSRM -I[...]/_sources/php/php-5.1.2/Zend    -I/usr/include -g  -c [...]/_sources/php/php-5.1.2/sapi/cli/php_cli.c -o sapi/cli/php_cli.lo
        /bin/sh [...]/_sources/php/php-5.1.2/libtool --silent --preserve-dup-deps --mode=compile cc  -Isapi/cli/ -I[...]/_sources/php/php-5.1.2/sapi/cli/ -DPHP_ATOM_INC -I[...]/_sources/php/php-5.1.2/include -I[...]/_sources/php/php-5.1.2/main -I[...]/_sources/php/php-5.1.2 -I[...]/libxml2/include/libxml2 -I[...]/_sources/php/php-5.1.2/ext/date/lib -I[...]/_sources/php/php-5.1.2/TSRM -I[...]/_sources/php/php-5.1.2/Zend    -I/usr/include -g  -c [...]/_sources/php/php-5.1.2/sapi/cli/php_cli_readline.c -o sapi/cli/php_cli_readline.lo
        /bin/sh [...]/_sources/php/php-5.1.2/libtool --silent --preserve-dup-deps --mode=compile cc  -Isapi/cli/ -I[...]/_sources/php/php-5.1.2/sapi/cli/ -DPHP_ATOM_INC -I[...]/_sources/php/php-5.1.2/include -I[...]/_sources/php/php-5.1.2/main -I[...]/_sources/php/php-5.1.2 -I[...]/libxml2/include/libxml2 -I[...]/_sources/php/php-5.1.2/ext/date/lib -I[...]/_sources/php/php-5.1.2/TSRM -I[...]/_sources/php/php-5.1.2/Zend    -I/usr/include -g  -c [...]/_sources/php/php-5.1.2/sapi/cli/getopt.c -o sapi/cli/getopt.lo
        /bin/sh [...]/_sources/php/php-5.1.2/libtool --silent --preserve-dup-deps --mode=compile cc  -Imain/ -I[...]/_sources/php/php-5.1.2/main/ -DPHP_ATOM_INC -I[...]/_sources/php/php-5.1.2/include -I[...]/_sources/php/php-5.1.2/main -I[...]/_sources/php/php-5.1.2 -I[...]/libxml2/include/libxml2 -I[...]/_sources/php/php-5.1.2/ext/date/lib -I[...]/_sources/php/php-5.1.2/TSRM -I[...]/_sources/php/php-5.1.2/Zend    -I/usr/include -g  -c main/internal_functions_cli.c -o main/internal_functions_cli.lo
        echo '\
\

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
----------------------------------------

I think BUILD_CLI and BUILD_CGI are wrong.
Can you please check?

Thanks,
Ionutz
 [2006-05-17 08:13 UTC] tony2001@php.net
So what exactly is wrong there?
 [2006-05-17 08:16 UTC] ionut dot aivanesei at amdocs dot com
In the 'make' output there are 2 line like
-----
        echo '\
\
-----
and this are exactly the lines where BUILD_CLI and BUILD_CGI should be executed. If you look to the definition of BUILD_CLI and BUILD_CGI you will see that it start with "echo '\...".
 [2006-05-17 12:29 UTC] ionut dot aivanesei at amdocs dot com
I found this line on 'configure' on line 12053 [from 113777]:

--------------------------------------------------
...
    case $host_alias in
      *aix*)
        BUILD_CGI="echo '\#! .' > php.sym && echo >>php.sym && nm -BCpg \`echo \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) | sed 's/\([A-Za-z0-9_]*\)\.lo/.libs\/\1.o/g'\` | \$(AWK) '{ if (((\$\$2 == \"T\") || (\$\$2 == \"D\") || (\$\$2 == \"B\")) && (substr(\$\$3,1,1) != \".\")) { print \$\$3 } }' | sort -u >> php.sym && \$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) -Wl,-brtl -Wl,-bE:php.sym \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
        ;;
...
--------------------------------------------------

This is from 'confiure' for PHP 5.1.2

Thanks,
Ionutz
 [2006-05-17 13:23 UTC] ionut dot aivanesei at amdocs dot com
The same errors I have also with 5.1.4 PHP version.

With 5.1.4 there are also other two compilation errors:
----------
"Zend/zend_language_parser.c", line 2585.1: 1506-046 (S) Syntax error.
make: 1254-004 The error code from the last command is 1.

"Zend/zend_ini_parser.c", line 1081.1: 1506-046 (S) Syntax error.
make: 1254-004 The error code from the last command is 1.
----------
The line containing ';' needs to be removed, otherwise make will fail with error shown above.

Ionutz
 [2006-05-17 14:20 UTC] ionut dot aivanesei at amdocs dot com
Hi there,

I managed to solve this by removing the AIX option from BUILD_CLI and BUILD_CGI in configure. Now it is using the default and it works ok.
 [2006-06-14 17:43 UTC] sniper@php.net
Try this configure line:

# ./configure --disable-all

Does it work then? And what kind of paths are [...] anyway?
 [2006-06-14 17:44 UTC] sniper@php.net
And make sure you have GNU tools in use, like GNU sed..
 [2006-06-22 16:43 UTC] burlybutler at hotmail dot com
I've found this bug too when compiling on the AIX platform. When doing the 'make' it just prints out a spurious line (echo '\), so no sapi/cli/php executable was made

As reported above, the problem can be worked around by using the default BUILD_CLI option in the configure script, which was fine. Either edit configure to disable the aix option, or put the default one directly in the Makefile (remove backslashes).

Perhaps the AIX BUILD_CLI option works/worked on some versions (or its something to do with shells) - must have been put there for a reason...
 [2007-01-19 20:15 UTC] lobster2 at xs4all dot nl
Problem (3) reported [19 Oct 2006 11:37pm UTC] sharanu_mudgal at yahoo dot com

Only important if you need the php CLI executable.

Worked around this by symlinking all .libs/*.o one dir higher up the hierarchy, where the .lo files with the same name reside.
 [2007-02-15 09:42 UTC] rainer dot tammer at schulergroup dot com
Hello,
I have a other solution to the nm problem ...
I changed the configure script.

I changed the nm relevant sed command:
  sed 's/\([A-Za-z0-9_]*\)\.o/\1.o/g' 
to
  sed 's/\([A-Za-z0-9_]*\)\.o/.libs\/\1.o/g'
.

As a result the nm no longer complains about the "0654-200 Cannot open the specified file.".

Bye
  Rainer
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 09:01:28 2024 UTC