|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58709 Installation successful but still having undefined functions
Submitted: 2009-06-01 02:34 UTC Modified: 2010-12-15 02:00 UTC
From: jsia18 at yahoo dot com Assigned: jon (profile)
Status: Closed Package: python (PECL)
PHP Version: 5.2.6 OS: Ubuntu jaunty
Private report: No CVE-ID: None
 [2009-06-01 02:34 UTC] jsia18 at yahoo dot com
    I have installed python in php in ubuntu.  It says it was successful and I already have in my extension directory and edited php.ini.  I've checked my phpinfo and I already so python there.  When I try to use the py_eval, py_call, etc. it says undefined function.  How do you make this work?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-03 18:23 UTC]
The functions have been renamed with a python_ prefix instead of a py_ prefix, so try python_eval() instead.
 [2009-10-15 18:32 UTC] ynt3697 at gmail dot com
How installed python in php in ubuntu. please report.
 [2010-08-11 02:52 UTC] karfes at gmail dot com
I also tried the extension on debian but i got the same error though the installation was successful
the installation gave this output:
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
building in /var/tmp/pear-build-root/python-0.8.0
running: /home/karfes/Desktop/python-0.8.0/python-0.8.0/configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20060613+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking for re2c... no
configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for embedded Python support... yes, shared
checking for Python files in default path... found in /usr
checking for dlopen in -ldl... yes
checking for Py_Initialize in -lpython2.5... yes
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 98304
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /var/tmp/pear-build-root/python-0.8.0/libtool --mode=compile gcc  -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5  -DHAVE_CONFIG_H  -g -O2   -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python.c -o python.lo
mkdir .libs
 gcc -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5 -DHAVE_CONFIG_H -g -O2 -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python.c  -fPIC -DPIC -o .libs/python.o
/home/karfes/Desktop/python-0.8.0/python-0.8.0/python.c: In function ?zif_python_version?:
/home/karfes/Desktop/python-0.8.0/python-0.8.0/python.c:222: warning: initialization discards qualifiers from pointer target type
/bin/sh /var/tmp/pear-build-root/python-0.8.0/libtool --mode=compile gcc  -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5  -DHAVE_CONFIG_H  -g -O2   -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_convert.c -o python_convert.lo
 gcc -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5 -DHAVE_CONFIG_H -g -O2 -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_convert.c  -fPIC -DPIC -o .libs/python_convert.o
/bin/sh /var/tmp/pear-build-root/python-0.8.0/libtool --mode=compile gcc  -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5  -DHAVE_CONFIG_H  -g -O2   -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_handlers.c -o python_handlers.lo
 gcc -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5 -DHAVE_CONFIG_H -g -O2 -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_handlers.c  -fPIC -DPIC -o .libs/python_handlers.o
/bin/sh /var/tmp/pear-build-root/python-0.8.0/libtool --mode=compile gcc  -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5  -DHAVE_CONFIG_H  -g -O2   -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_object.c -o python_object.lo
 gcc -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5 -DHAVE_CONFIG_H -g -O2 -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_object.c  -fPIC -DPIC -o .libs/python_object.o
/bin/sh /var/tmp/pear-build-root/python-0.8.0/libtool --mode=compile gcc  -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5  -DHAVE_CONFIG_H  -g -O2   -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_php.c -o python_php.lo
 gcc -I. -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5 -DHAVE_CONFIG_H -g -O2 -c /home/karfes/Desktop/python-0.8.0/python-0.8.0/python_php.c  -fPIC -DPIC -o .libs/python_php.o
/bin/sh /var/tmp/pear-build-root/python-0.8.0/libtool --mode=link gcc -DPHP_ATOM_INC -I/var/tmp/pear-build-root/python-0.8.0/include -I/var/tmp/pear-build-root/python-0.8.0/main -I/home/karfes/Desktop/python-0.8.0/python-0.8.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/python2.5  -DHAVE_CONFIG_H  -g -O2   -o -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/pear-build-root/python-0.8.0/modules  python.lo python_convert.lo python_handlers.lo python_object.lo python_php.lo -Wl,-rpath,/usr/lib/python2.5/config -L/usr/lib/python2.5/config -lpython2.5
gcc -shared  .libs/python.o .libs/python_convert.o .libs/python_handlers.o .libs/python_object.o .libs/python_php.o  -L/usr/lib/python2.5/config -lpython2.5  -Wl,-rpath -Wl,/usr/lib/python2.5/config -Wl,-soname -Wl, -o .libs/
(cd .libs && rm -f && ln -s ../
/bin/sh /var/tmp/pear-build-root/python-0.8.0/libtool --mode=install cp ./ /var/tmp/pear-build-root/python-0.8.0/modules
cp ./.libs/ /var/tmp/pear-build-root/python-0.8.0/modules/
cp ./.libs/python.lai /var/tmp/pear-build-root/python-0.8.0/modules/
PATH="$PATH:/sbin" ldconfig -n /var/tmp/pear-build-root/python-0.8.0/modules
Libraries have been installed in:

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and manual pages.

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-python-0.8.0" install
Installing shared extensions:     /var/tmp/pear-build-root/install-python-0.8.0/usr/lib/php5/20060613+lfs/
running: find "/var/tmp/pear-build-root/install-python-0.8.0" -ls
573444    4 drwxr-xr-x   3 root     root         4096 Aug 10 15:00 /var/tmp/pear-build-root/install-python-0.8.0
573476    4 drwxr-xr-x   3 root     root         4096 Aug 10 15:00 /var/tmp/pear-build-root/install-python-0.8.0/usr
573477    4 drwxr-xr-x   3 root     root         4096 Aug 10 15:00 /var/tmp/pear-build-root/install-python-0.8.0/usr/lib
573478    4 drwxr-xr-x   3 root     root         4096 Aug 10 15:00 /var/tmp/pear-build-root/install-python-0.8.0/usr/lib/php5
573479    4 drwxr-xr-x   2 root     root         4096 Aug 10 15:00 /var/tmp/pear-build-root/install-python-0.8.0/usr/lib/php5/20060613+lfs
573475  136 -rwxr-xr-x   1 root     root       133129 Aug 10 15:00 /var/tmp/pear-build-root/install-python-0.8.0/usr/lib/php5/20060613+lfs/

i then looked for and couldnt find it in the php extensions directory as indicated above. please help.
 [2010-12-15 02:00 UTC]
I'm not sure why it built the module into /var/tmp/pear-build-
root/python-0.8.0/modules, but you can safely move 
out of that directory and into your PHP extensions directory.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 23 23:01:23 2020 UTC