[mod_python] undefined symbol: forkpty

Graham Dumpleton graham.dumpleton at gmail.com
Sat Aug 4 06:08:52 EDT 2007


In the same directory as the Apache httpd binary there is a file
called envvars. In that file add:

  LD_PRELOAD=/usr/lib/libutil.so
  export LD_PRELOAD

Alternatively, after having run 'configure' on mod_python source code,
modify src/Makefile and add '-lutil' into the LDFLAGS definition. Then
compile mod_python and install as per normal.

Graham

On 04/08/07, Justin Wickett <justin.wickett at duke.edu> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Graham,
>
> I am having the exact same problem with my FC7 image that Gustavo
> Steigert mentioned. I used 'yum' to download and install the HTTPD
> RPM (version 2.2.4-4.1.fc7) as well as the HTTPD-devel RPM, so I
> didn't compile anything myself. I did however compile mod_python
> 3.3.1. When I went to start up Apache, I received:
>
> Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/
> httpd.conf: Syntax error on line 6 of /etc/httpd/conf.d/python.conf:
> Cannot load /usr/lib/httpd/modules/mod_python.so into server: /usr/
> lib/httpd/modules/mod_python.so: undefined symbol: forkpty
>
> Here is some info about my libutil.a...
>
> - -bash-3.2# nm /usr/lib/libutil.a | grep forkpty
> forkpty.o:
> 00000000 T forkpty
>
> Because I was not the one who compiled Apache,  I don't think there
> is a way to link it at this point. Do you (or anyone else) have any
> advice as to how to fix this problem? Should I compile Apache and
> link the library then? Thanks in advance...
>
> Justin Wickett
> Duke 2010
> http://www.duke.edu/~jyw2
>
>
>
> On Jul 29, 2007, at 4:13 AM, Graham Dumpleton wrote:
>
> > On 28/07/07, Gustavo Steigert <steigert at gmail.com> wrote:
> >> Hi guys,
> >>
> >> I installed Apache2 (from source) and it worked fine. Then I
> >> installed
> >> mod_python (also from source) and no error was shown; after, I
> >> configured
> >> the httpd.conf for loading mod_python, and now when I try to start
> >> apache,
> >> it says:
> >>
> >>  httpd: Syntax error on line 54 of
> >> /usr/local/apache2/conf/httpd.conf: Cannot load
> >> /usr/local/apache2/modules/mod_python.so into server:
> >> /usr/local/apache2/modules/mod_python.so: undefined symbol:
> >> forkpty
> >>
> >> Version information:
> >>
> >> httpd 2.2.4
> >> mod_python 3.3.1
> >> fedora 7Can anyone please help?
> >
> > The forkpty function isn't even used by mod_python, although it is
> > used in the Python 'posix' module which would probably be
> > automatically loaded by Python at startup.
> >
> > What I would suggest is the problem is that whatever system library
> > defines that function isn't being linked into Apache when it is being
> > built.
> >
> > First step would thus be to find out which system library contains
> > that function. To do this, run 'nm' on each of the system libraries in
> > /usr/lib until you find it. On Linux box I have access to the library
> > is libutil.
> >
> > $ nm libutil.a | grep forkpty
> > forkpty.o:
> > 00000000 T forkpty
> >
> > Make sure this library is linked into Apache, preferably as a shared
> > library as Apache itself may not require the function and wouldn't
> > link it in if libutil is a static library.
> >
> > Graham
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (Darwin)
>
> iD8DBQFGtCntJSH8HIex+CkRAlqpAJ40Ydh6+akifwyy24UKx3XoFyQv/wCcDmVA
> KNa42ElKmBlM7FDXUyfJA+I=
> =F5pV
> -----END PGP SIGNATURE-----
>


More information about the Mod_python mailing list