php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49078 Make Failed sapi/cli/php Error 1
Submitted: 2009-07-27 18:40 UTC Modified: 2009-08-05 01:00 UTC
Votes:58
Avg. Score:4.2 ± 1.1
Reproduced:57 of 57 (100.0%)
Same Version:16 (28.1%)
Same OS:10 (17.5%)
From: kdprice at baylou dot com Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 5.3SVN-2009-07-27 (snap) OS: CentOS 5
Private report: No CVE-ID: None
 [2009-07-27 18:40 UTC] kdprice at baylou dot com
Description:
------------
Make for php5.3.2 installation failed with an Error 1 related to sapi/cli/php.



Reproduce code:
---------------
./configure --with-apxs2=/usr/local/apache2/bin/apxs --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/lib --disable-cgi --with-gettext --with-gdbm --with-libxml-dir=/usr/include/libxml2/libxml --with-openssl=/usr/local/ssl --with-pear --with-zlib --with-pgsql=/usr/local/pgsql

Expected result:
----------------
A confirmation of success prior to Make Install

Actual result:
--------------
ext/standard/.libs/dns.o: In function `php_parserr':
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:389: undefined reference to `__dn_expand'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:439: undefined reference to `__dn_expand'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:623: undefined reference to `__dn_expand'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:645: undefined reference to `__dn_expand'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:484: undefined reference to `__dn_expand'
ext/standard/.libs/dns.o:/tmp/Software/php5.3-200907271630/ext/standard/dns.c:490: more undefined references to `__dn_expand' follow
ext/standard/.libs/dns.o: In function `zif_dns_check_record':
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:323: undefined reference to `__res_search'
ext/standard/.libs/dns.o: In function `zif_dns_get_mx':
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:878: undefined reference to `__res_search'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:889: undefined reference to `__dn_skipname'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:895: undefined reference to `__dn_skipname'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:907: undefined reference to `__dn_expand'
ext/standard/.libs/dns.o: In function `zif_dns_get_record':
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:769: undefined reference to `__res_nmkquery'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:777: undefined reference to `__res_nsend'
/tmp/Software/php5.3-200907271630/ext/standard/dns.c:796: undefined reference to `__dn_skipname'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-28 19:34 UTC] jani@php.net
We haven't released 5.3.1 even, so how could you test 5.3.2? :D
Anyway, I can't reproduce this under CentOS 5, using latest SVN 
checkout. Please try again, this time using _clean_ sources and 
configure _outside_ sources:

/some/dir/sources
/some/dir/build

# cd /some/dir/build
# /some/dir/sources/configure <your options here>

 [2009-07-30 08:03 UTC] max at tnug dot com
Had the same problem today on PHP 5.3.0-stable.

Debian 2.6.22 #2 SMP x86_64 GNU/Linux.

Was able to solve the problem quickly and easily by adding -lresolve to the EXTRA_LIBS in my generated makefile.
 [2009-08-05 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-09-09 21:12 UTC] dipakgarg at gmail dot com
i tried to install php5.3.0 on ubuntu today and faced the similar problem, plz help me with the solution
 [2009-10-05 08:47 UTC] php_spam at taf dot nu
adding "-lresolve" didnt work for me:

/usr/bin/ld: cannot find -lresolve
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

PHP 5.3.0 stable
OS: Linux 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:37:32 EDT 2006
Configure line:
./configure --with-apxs2=/somewhere/httpd/bin/apxs --with-mysql=/usr/lib/ --prefix=/usr/local/php5 --with-gd --with-jpeg-dir --with-zlib-dir --enable-ftp --with-ttf --with-gd-native-ttf --with-freetype-dir --with-xpm-dir --enable-mbstring --enable-zip --disable-posix-threads --with-mcrypt=/somewhere/libmcrypt-2.5.8 --enable-sockets --with-openssl=/usr/local/ssl/ --enable-pcntl --with-mime-magic --enable-bcmath --enable-dbase

Sorry for bumping this but i hope this is fix-able.
 [2009-10-05 09:55 UTC] php_spam at taf dot nu
with "-lresolv"  (notice no "e" at the end) will stop the error but creates an unsable php install for me.
 [2009-10-15 07:31 UTC] eric-delas at wanadoo dot fr
I got the same problem, on FedoraCore 9 and PHP 5.3.0
 [2009-10-30 19:48 UTC] rofc at rofc dot com dot ar
Same problem here with FC5 on a x86_64 server.
 [2010-07-12 13:27 UTC] smileyrecords at gmail dot com
same problem php 5.3.3rc2
 [2010-08-16 22:49 UTC] flood at itnews-bg dot com
Have the same problem. 
I'm trying to compile php 5.3.3 on Slackware 12.2 and I can't get it to work.
This is the line I'm using
./configure --with-apxs2=/usr/local/apache-2.2.15/bin/apxs --with-pgsql=/usr/local/pgsql/

The problem comes somewhere in "--with-pgsql". If I remove that line it builds with no problems.
 [2010-08-16 22:57 UTC] flood at itnews-bg dot com
Actually, I just managed to get it working.
After adding "-lresolv" to the "EXTRA_LIBS" line of "Makefile" it compiled successfully. 

The line that worked for me was:
EXTRA_LIBS = -lresolv -lcrypt -lcrypt -lpq -lrt -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt

Hope this helps somebody.
Sorry for the double post.
 [2010-10-11 04:40 UTC] codebudo at gmail dot com
Same problem with php5.3.3 on OS X 10.6. (Darwin bugs.local 10.4.0 Darwin Kernel 
Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 
i386)

"-lresolv" was already in my EXTRA_LIB, but I still can't compile.  This is my 
EXTRA_LIB:


EXTRA_LIBS = -lresolv -lmysqlclient -liconv -liconv -lpng -lz -lcurl -lz -lm -
lxml2 -lz -licucore -lm -lssl -lcrypto -lz -lcurl -lxml2 -lz -licucore -lm -
lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 
-lz -licucore -lm -lxml2 -lz -licucore -lm


My configure line:

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-gd --
with-zlib --with-mcrypt-dir=/opt/local/include --with-png --with-jpeg --enable-
exif --with-xml --with-apxs2=/usr/local/apache/bin/apxs --with-curl --with-
openssl --enable-soap --with-iconv
 [2011-01-23 04:45 UTC] de at engeljournal dot com
I get the same problem.

I start with

./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-sockets --enable-
soap --with-gd --with-zlib --with-jpeg-dir=/usr --with-curl --with-png-dir=/usr 
--with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd

make && make install

Expected result = success
-----------------
Actual result

ext/mysql/.libs/php_mysql.o: In function `_free_mysql_result':
php_mysql.c:(.text+0x1c): undefined reference to `mysql_free_result'
ext/mysql/.libs/php_mysql.o: In function `php_mysql_select_db':
php_mysql.c:(.text+0xb8): undefined reference to `mysql_eof'
php_mysql.c:(.text+0xe0): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x10c): undefined reference to `mysql_select_db'
ext/mysql/.libs/php_mysql.o: In function `_close_mysql_link':
php_mysql.c:(.text+0x15b): undefined reference to `mysql_close'
ext/mysql/.libs/php_mysql.o: In function `_close_mysql_plink':
php_mysql.c:(.text+0x1bc): undefined reference to `mysql_close'
ext/mysql/.libs/php_mysql.o: In function `zm_startup_mysql':
php_mysql.c:(.text+0x45a): undefined reference to `mysql_server_init'
ext/mysql/.libs/php_mysql.o: In function `zm_shutdown_mysql':
php_mysql.c:(.text+0x486): undefined reference to `mysql_server_end'
ext/mysql/.libs/php_mysql.o: In function `zm_info_mysql':
php_mysql.c:(.text+0x5f2): undefined reference to `mysql_get_client_info'
ext/mysql/.libs/php_mysql.o: In function `php_mysql_do_connect':
php_mysql.c:(.text+0x725): undefined reference to `mysql_get_client_version'
php_mysql.c:(.text+0x736): undefined reference to `mysql_get_client_version'
php_mysql.c:(.text+0xcd0): undefined reference to `mysql_init'
php_mysql.c:(.text+0xcff): undefined reference to `mysql_options'
php_mysql.c:(.text+0xd46): undefined reference to `mysql_real_connect'
php_mysql.c:(.text+0xd73): undefined reference to `mysql_error'
php_mysql.c:(.text+0xdb0): undefined reference to `mysql_errno'
php_mysql.c:(.text+0xe10): undefined reference to `mysql_options'
php_mysql.c:(.text+0xf4f): undefined reference to `mysql_ping'
php_mysql.c:(.text+0xf63): undefined reference to `mysql_errno'
php_mysql.c:(.text+0xfb5): undefined reference to `mysql_real_connect'
php_mysql.c:(.text+0x104d): undefined reference to `mysql_options'
php_mysql.c:(.text+0x1254): undefined reference to `mysql_init'
php_mysql.c:(.text+0x12fc): undefined reference to `mysql_options'
php_mysql.c:(.text+0x1343): undefined reference to `mysql_real_connect'
php_mysql.c:(.text+0x1370): undefined reference to `mysql_error'
php_mysql.c:(.text+0x13ad): undefined reference to `mysql_errno'
php_mysql.c:(.text+0x140d): undefined reference to `mysql_options'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_close':
php_mysql.c:(.text+0x172a): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x1752): undefined reference to `mysql_fetch_row'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_get_client_info':
php_mysql.c:(.text+0x194a): undefined reference to `mysql_get_client_info'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_get_host_info':
php_mysql.c:(.text+0x1aad): undefined reference to `mysql_get_host_info'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_get_proto_info':
php_mysql.c:(.text+0x1c15): undefined reference to `mysql_get_proto_info'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_get_server_info':
php_mysql.c:(.text+0x1d2b): undefined reference to `mysql_get_server_info'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_info':
php_mysql.c:(.text+0x1e8e): undefined reference to `mysql_info'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_thread_id':
php_mysql.c:(.text+0x2017): undefined reference to `mysql_thread_id'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_stat':
php_mysql.c:(.text+0x215e): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x2186): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x21ae): undefined reference to `mysql_stat'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_client_encoding':
php_mysql.c:(.text+0x2332): undefined reference to `mysql_character_set_name'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_set_charset':
php_mysql.c:(.text+0x24a1): undefined reference to `mysql_set_character_set'
ext/mysql/.libs/php_mysql.o: In function `php_mysql_do_query_general':
php_mysql.c:(.text+0x25b4): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x25dc): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x2614): undefined reference to `mysql_set_server_option'
php_mysql.c:(.text+0x2683): undefined reference to `mysql_real_query'
php_mysql.c:(.text+0x2698): undefined reference to `mysql_errno'
php_mysql.c:(.text+0x26a8): undefined reference to `mysql_error'
php_mysql.c:(.text+0x26ec): undefined reference to `mysql_use_result'
php_mysql.c:(.text+0x2807): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x281f): undefined reference to `mysql_free_result'
php_mysql.c:(.text+0x2835): undefined reference to `mysql_real_query'
php_mysql.c:(.text+0x2851): undefined reference to `mysql_errno'
php_mysql.c:(.text+0x2861): undefined reference to `mysql_error'
php_mysql.c:(.text+0x28ab): undefined reference to `mysql_use_result'
php_mysql.c:(.text+0x28bd): undefined reference to `mysql_store_result'
php_mysql.c:(.text+0x28d4): undefined reference to `mysql_field_count'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_list_dbs':
php_mysql.c:(.text+0x2d11): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x2d39): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x2d66): undefined reference to `mysql_list_dbs'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_list_tables':
php_mysql.c:(.text+0x2f28): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x2f50): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x2f7d): undefined reference to `mysql_list_tables'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_list_fields':
php_mysql.c:(.text+0x3158): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x3180): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x31b1): undefined reference to `mysql_list_fields'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_list_processes':
php_mysql.c:(.text+0x333c): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x3364): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x338c): undefined reference to `mysql_list_processes'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_error':
php_mysql.c:(.text+0x352f): undefined reference to `mysql_error'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_errno':
php_mysql.c:(.text+0x3690): undefined reference to `mysql_errno'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_affected_rows':
php_mysql.c:(.text+0x37a3): undefined reference to `mysql_affected_rows'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_escape_string':
php_mysql.c:(.text+0x3828): undefined reference to `mysql_escape_string'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_real_escape_string':
php_mysql.c:(.text+0x399e): undefined reference to `mysql_real_escape_string'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_insert_id':
php_mysql.c:(.text+0x3af1): undefined reference to `mysql_insert_id'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_result':
php_mysql.c:(.text+0x3be5): undefined reference to `mysql_num_rows'
php_mysql.c:(.text+0x3c51): undefined reference to `mysql_data_seek'
php_mysql.c:(.text+0x3d0e): undefined reference to `mysql_field_seek'
php_mysql.c:(.text+0x3d55): undefined reference to `mysql_fetch_field'
php_mysql.c:(.text+0x3f65): undefined reference to `mysql_num_fields'
php_mysql.c:(.text+0x3fac): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x3fc0): undefined reference to `mysql_fetch_lengths'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_num_rows':
php_mysql.c:(.text+0x41aa): undefined reference to `mysql_num_rows'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_num_fields':
php_mysql.c:(.text+0x424d): undefined reference to `mysql_num_fields'
ext/mysql/.libs/php_mysql.o: In function `php_mysql_fetch_hash':
php_mysql.c:(.text+0x444e): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x4462): undefined reference to `mysql_fetch_lengths'
php_mysql.c:(.text+0x44aa): undefined reference to `mysql_field_seek'
php_mysql.c:(.text+0x44b3): undefined reference to `mysql_fetch_field'
php_mysql.c:(.text+0x46d4): undefined reference to `mysql_fetch_field'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_data_seek':
php_mysql.c:(.text+0x4ba9): undefined reference to `mysql_num_rows'
php_mysql.c:(.text+0x4c03): undefined reference to `mysql_data_seek'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_fetch_lengths':
php_mysql.c:(.text+0x4cab): undefined reference to `mysql_fetch_lengths'
php_mysql.c:(.text+0x4ce2): undefined reference to `mysql_num_fields'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_fetch_field':
php_mysql.c:(.text+0x4f92): undefined reference to `mysql_num_fields'
php_mysql.c:(.text+0x4fe0): undefined reference to `mysql_field_seek'
php_mysql.c:(.text+0x4fe9): undefined reference to `mysql_fetch_field'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_field_seek':
php_mysql.c:(.text+0x5342): undefined reference to `mysql_num_fields'
php_mysql.c:(.text+0x539b): undefined reference to `mysql_field_seek'
ext/mysql/.libs/php_mysql.o: In function `php_mysql_field_info':
php_mysql.c:(.text+0x547d): undefined reference to `mysql_num_fields'
php_mysql.c:(.text+0x54df): undefined reference to `mysql_field_seek'
php_mysql.c:(.text+0x54e8): undefined reference to `mysql_fetch_field'
ext/mysql/.libs/php_mysql.o: In function `zif_mysql_ping':
php_mysql.c:(.text+0x5f0d): undefined reference to `mysql_eof'
php_mysql.c:(.text+0x5f35): undefined reference to `mysql_fetch_row'
php_mysql.c:(.text+0x5f65): undefined reference to `mysql_ping'
collect2: ld returned 1 exit status
 [2013-03-16 15:58 UTC] webmaster at tribunalqro dot gob dot mx
I used make clean ... make and it worked!
No need for anything else.
 [2016-05-24 05:45 UTC] nulash2010cool at gmail dot com
I also have the same error.. Pls help.

My specification: CentOs 6.5, MySQL 5.6.30 Apache 2.4.20 Php 5.6.21

The line i used to configure:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/

Output obtained:
/usr/local/src/php/php-5.6.21/ext/dom/node.c:1901: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/node.c:1907: undefined reference to `xmlOutputBufferGetContent'
ext/dom/.libs/documenttype.o: In function `dom_documenttype_internal_subset_read':
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetContent'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
ext/simplexml/.libs/simplexml.o: In function `zim_simplexml_element_asXML':
/usr/local/src/php/php-5.6.21/ext/simplexml/simplexml.c:1428: undefined reference to `xmlOutputBufferGetContent'
/usr/local/src/php/php-5.6.21/ext/simplexml/simplexml.c:1428: undefined reference to `xmlOutputBufferGetSize'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
 [2016-05-24 05:46 UTC] nulash2010cool at gmail dot com
I also have the same error.. Pls help.

My specification: CentOs 6.5, MySQL 5.6.30 Apache 2.4.20 Php 5.6.21

The line i used to configure:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/

Output obtained:
/usr/local/src/php/php-5.6.21/ext/dom/node.c:1901: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/node.c:1907: undefined reference to `xmlOutputBufferGetContent'
ext/dom/.libs/documenttype.o: In function `dom_documenttype_internal_subset_read':
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetContent'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
ext/simplexml/.libs/simplexml.o: In function `zim_simplexml_element_asXML':
/usr/local/src/php/php-5.6.21/ext/simplexml/simplexml.c:1428: undefined reference to `xmlOutputBufferGetContent'
/usr/local/src/php/php-5.6.21/ext/simplexml/simplexml.c:1428: undefined reference to `xmlOutputBufferGetSize'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC