php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12636 non-linked libpam function?
Submitted: 2001-08-07 19:05 UTC Modified: 2001-08-09 20:56 UTC
From: scarfboy at yahoo dot com Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.0.6 OS: Linux (SuSE 7.1)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: scarfboy at yahoo dot com
New email:
PHP Version: OS:

 

 [2001-08-07 19:05 UTC] scarfboy at yahoo dot com
I just compiled PHP 4.0.6 from the sources, (well, after 
fighting with it a bit, but never mind that) and apache 
won't load the module. When i try to start apache:

Syntax error on line 147 of /etc/httpd/httpd.conf:
Cannot load /usr/lib/apache/libphp4.so into server: 
undefined symbol: pam_end

(line 147 is the one that loads the module)

From both someone else's report and my trial and error, i 
figured it is the imap module that is the problem.
I do have the libpam library and the function is in that 
library:

# objdump -T /lib/libpam.so.0.72 | grep pam_end
00001b40 g    DF .text  0000025f  Base        pam_end

The thing is that the php module isn't linked with this. 
Now i don't know enough about all this funky dynamic stuff 
to fix this.. (or even know for sure that's the problem) 
but it strikes me that if the imap module depends on this 
library it should put that in its makefile or whereever.
I can live without imap, but i do want it sometime.. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-07 19:08 UTC] sniper@php.net
What was the configure line used to configure PHP?
Could you please try the latest CVS snapshot from http://snaps.php.net/ since there have been few fixes
in it.


--Jani

 [2001-08-07 19:19 UTC] scarfboy at yahoo dot com
Sure. I basically copied it from the phpinfo page that was 
running on the php module that came with SuSE 7.1, and 
tweaked it a bit. Like i removed the things that kept me 
from compiling it, and removed stuff i knew i wouldn't 
need.

There's a handful of other functions it's complaining 
about. Bloody hell, why can't stuff like this ever just 
WORK? *grumble*

Ermm anyhow. I never used CVS.. I never programmed 
something big enough to make it useful enough. gimme a 
bunch of commands to type and i'll do it.

./configure --prefix=/usr --bindir=/usr/bin 
--libdir=/usr/lib --with-exec-dir=/usr/lib/php/bin 
--with-pgsql=/usr --with-gd=/usr/local 
--with-tiff-dir=/usr --with-jpeg-dir=/usr 
--with-png-dir=/usr --with-xpm-dir=/usr/X11R6 
--with-pdflib=/usr --with-zlib=yes --with-xml --with-ttf 
--with-readline --with-ftp --with-java --with-curl 
--enable-versioning --with-ming=/usr --enable-bcmath 
--enable-trans-sid --with-imap 
--enable-inline-optimization --enable-track-vars 
--enable-magic-quotes --enable-safe-mode --enable-sockets
--enable-sysvsem --enable-sysvshm --enable-shmop 
--enable-calendar --enable-exif --enable-ftp 
--enable-memory-limit --enable-wddx 
--with-config-file-path=/etc/httpd/ 
--with-apxs=/usr/sbin/apxs 
--with-exec-dir=/usr/lib/apache/bin --without-mysql

 [2001-08-07 19:21 UTC] jeroen@php.net
Goto snaps.php.net, and get the latest .gz. It works exactly the same as the official release, and is lagging no more than 3 hours to CVS - no problem in this case
 [2001-08-07 19:51 UTC] scarfboy at yahoo dot com
ah... last time i tried to use cvs it was so annoying i 
decided it's an unnecessary evil. I was under the 
impression they were patches. well, whatever.

anyhow, in the latest cvs, this problem is caught by the 
makefile. well, sort of. in config.log i see normal 
``undefined reference to `whatever''' lines.. all starting 
with pam_. It can't find the libpam library. Which is 
weird, since it's in my LD_LIBRARY_PATH and all...

The message configure itself gives is:
``configure: error: This c-client library is build with 
SSL support.'', and the message to ``Add 
--with-imap-ssl<=DIR> to your configure line. Check 
config.log for details.''

The relevant part of config.log:
configure:24000: checking for IMAP support
configure:24287: checking for pam_start in -lpam
configure:24306: gcc -o conftest -g -O2  -DEAPI_MM 
-DSINGLE_LISTEN_UNSERIALIZED_ACCEPT 
-D_LARGEF/usr/i486-suse-linux/bin/ld: cannot find -lpam
collect2: ld returned 1 exit status
configure: failed program was:
#line 24295 "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 pam_start();
 
int main() {
pam_start()
; return 0; }
configure:24334: checking for crypt in -lcrypt
configure:24850: gcc -o conftest -g -O2  -DEAPI_MM 
-DSINGLE_LISTEN_UNSERIALIZED_ACCEPT 
-D_LARGEF/usr/lib/libc-client.so: undefined reference to 
`pam_end'
/usr/lib/libc-client.so: undefined reference to 
`pam_authenticate'
/usr/lib/libc-client.so: undefined reference to 
`pam_setcred'
/usr/lib/libc-client.so: undefined reference to 
`pam_acct_mgmt'
/usr/lib/libc-client.so: undefined reference to `pam_start'
collect2: ld returned 1 exit status
configure: failed program was:
#line 24825 "configure"
#include "confdefs.h"
 
      void mm_log(void){}
      void mm_dlog(void){}
      void mm_flags(void){}
      void mm_fatal(void){}
      void mm_critical(void){}
      void mm_nocritical(void){}
      void mm_notify(void){}
      void mm_login(void){}
      void mm_diskerror(void){}
      void mm_status(void){}
      void mm_lsub(void){}
      void mm_list(void){}
      void mm_exists(void){}
      void mm_searched(void){}
      void mm_expunged(void){}
      char mail_open();
      int main() {
        mail_open(0,"",0);
        return 0;
      }

 [2001-08-07 19:59 UTC] scarfboy at yahoo dot com
However, it doesn't compile. There seems to be a bug in 
the Zend thing. This is as far as it got:


Making all in Zend
make[1]: Entering directory 
`/root/phptmp/php4-200108071635/Zend'
/bin/sh ../libtool --silent --mode=compile gcc 
-DHAVE_CONFIG_H -I. -I. -I../main   -DEAPI_MM 
-DSINGLE_LISTEN_UNSERIALIZED_ACCEPT -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -DHARD_SERVER_LIMIT=2048 
-DDYNAMIC_MODULE_LIMIT=128 -DLINUX=22 -DMOD_SSL=208100 
-DEAPI -DUSE_EXPAT -I../TSRM  -g -O2 -prefer-pic -c 
zend_language_parser.c
/bin/sh ../libtool --silent --mode=compile gcc 
-DHAVE_CONFIG_H -I. -I. -I../main   -DEAPI_MM 
-DSINGLE_LISTEN_UNSERIALIZED_ACCEPT -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -DHARD_SERVER_LIMIT=2048 
-DDYNAMIC_MODULE_LIMIT=128 -DLINUX=22 -DMOD_SSL=208100 
-DEAPI -DUSE_EXPAT -I../TSRM  -g -O2 -prefer-pic -c 
zend_language_scanner.c
zend_language_scanner.c:2697: warning: parameter names 
(without types) in function declaration
yacc -p ini_ -v -d ./zend_ini_parser.y -o zend_ini_parser.c
usage: yacc [-dlrtv] [-b file_prefix] [-p symbol_prefix] 
filename
make[1]: *** [zend_ini_parser.c] Error 1
make[1]: Leaving directory 
`/root/phptmp/php4-200108071635/Zend'
make: *** [all-recursive] Error 1
 [2001-08-08 18:00 UTC] scarfboy at yahoo dot com
i should say, after i removed the --with-imap option, 
`configure' worked and i typed `make', it got exactly that 
far. I fiddled with the makefile a little, but couldn't 
fix it. (i don't know anything about yacc..)

 [2001-08-09 03:27 UTC] sniper@php.net
First, this should work fine with PHP 4.0.6.
Where is the libpam.so in your system?
Is the path to that file in your /etc/ld.so.conf ??
Have you tried to run '/sbin/ldconfig' ever?
Try with fresh sources after these requirements are filled.

--Jani

 [2001-08-09 15:07 UTC] scarfboy at yahoo dot com
obviously it should.
just a obvious is that it doesn't.

those requirements -were- filled, but just to humor you...
libpam is in /lib. Somewhat weirdly, that's not in my 
LD_LIBRARY_PATH automatically, but -types- now it is (i 
did that before), and also in my ld.so.conf, and ldconfig 
has been run. ``ldconfig -v | grep pam'' shows:
(i guess the `more than once' this is about it being in 
the config file and the environment setting? whatever.)

ldconfig: Path `/lib' given more than once
        libpamc.so.0 -> libpamc.so.0.72
        libpam_misc.so.0 -> libpam_misc.so.0.72
        libpam.so.0 -> libpam.so.0.72
        libpamc.so.0 -> libpamc.so.0.72
        libpam_misc.so.0 -> libpam_misc.so.0.72
        libpam.so.0 -> libpam.so.0.72

so it's definately there. Perhaps not exactly in the form 
php wants to see it, but even the symbol it's looking for 
, according to the last lines configure gives me:

checking for pam_start in -lpam... no
checking for crypt in -lcrypt... (cached) yes
configure: error: This c-client library is build with SSL 
support.

      Add --with-imap-ssl<=DIR> to your configure line. 
Check config.log for details.

..are in /lib/libpam.so.0.72, according to objdump:
(by the by, that (cached) thing strikes me as weird too as 
this is the first ./configure command i gave since i 
removed and untarred the directory)

objdump -T /lib/libpam.so.0.72 | grep pam_start
00003a70 g    DF .text  0000007a  Base        
_pam_start_handlers
00002350 g    DF .text  0000002d  Base        
_pam_start_timer
00001da0 g    DF .text  0000030c  Base        pam_start

(sorry for the wrapping, that's this input field)
So it's not that libpam is somehow wrong. Forigive me for 
asking, but isn't that a library that linux doesn't run 
without in the first place?
Anyhow, my config.log from the point where it starts 
checking stuff for imap (in case anything's changed):

configure:24000: checking for IMAP support
configure:24287: checking for pam_start in -lpam
configure:24306: gcc -o conftest -g -O2  -DEAPI_MM 
-DSINGLE_LISTEN_UNSERIALIZED_ACCEPT
/usr/i486-suse-linux/bin/ld: cannot find -lpam
collect2: ld returned 1 exit status
configure: failed program was:
#line 24295 "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 pam_start();
int main() {
pam_start()
; return 0; }
configure:24334: checking for crypt in -lcrypt
configure:24850: gcc -o conftest -g -O2  -DEAPI_MM 
-DSINGLE_LISTEN_UNSERIALIZED_ACCEPT
/usr/lib/libc-client.so: undefined reference to `pam_end'
/usr/lib/libc-client.so: undefined reference to 
`pam_authenticate'
/usr/lib/libc-client.so: undefined reference to 
`pam_setcred'
/usr/lib/libc-client.so: undefined reference to 
`pam_acct_mgmt'
/usr/lib/libc-client.so: undefined reference to `pam_start'
collect2: ld returned 1 exit status
configure: failed program was:
#line 24825 "configure"
#include "confdefs.h"
 
      void mm_log(void){}
      void mm_dlog(void){}
      void mm_flags(void){}
      void mm_fatal(void){}
      void mm_critical(void){}
      void mm_nocritical(void){}
      void mm_notify(void){}
      void mm_login(void){}
      void mm_diskerror(void){}
      void mm_status(void){}
      void mm_lsub(void){}
      void mm_list(void){}
      void mm_exists(void){}
      void mm_searched(void){}
      void mm_expunged(void){}
      char mail_open();
      int main() {
        mail_open(0,"",0);
        return 0;
      }

I guess the libc-client is the fallback option, except it 
won't work without SSL, which is somehow related to why 
this doesn't work either? (not that there's really an 
humanly (user-ly, whatever) understandable reason, or 
suggestion or alternative listed) 


As to the thing not compiling even without this imap 
weirdness, do i just start another bug thread? (oh, i 
guess i search for it first...)

 [2001-08-09 18:15 UTC] sniper@php.net
I should have guessed this before:

You haven't installed the pam-devel.rpm
Install it, and you will have no more troubles 
with it. Same goes for every other package PHP
might need. Just install them as you come across 
same kind of problems.

Also, remember to delete config.cache before 
configure (after installing a devel package) and
do 'make clean'  after configure.

-Jani

 [2001-08-09 20:56 UTC] scarfboy at yahoo dot com
that did it. i actually had to do that for half a dozen 
other packages, but here the error message just seemed to 
hint nothing in the direction that that would help...

I gues i'll just download the latest cvs (the one that 
came out two days after the one i got) about the Zend 
thing.. Joy, more to download... 

 [2003-01-15 10:50 UTC] e_landivar at palosanto dot com
I had a similar problem... I did the following.

- I did create a simbolic link to libpam.so.0 and
  libpam_misc.so.0

  cd /lib/
  ln -s libpam.so.0 libpam.so
  ln -s libpam_misc.so.0 libpam_misc.so

- Then... ran the configure script once more...

  cd /path/to/php/source/
  rm config.cache
  ./configure (options)

- And... make, make install, etc...

I hope that fix your problem...

P.D. Sorry for my english.

Edgar Landivar
PaloSanto Solutions - Innovating the Internet
www.palosanto.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 21:01:30 2024 UTC