Link to home
Start Free TrialLog in
Avatar of flumpydog
flumpydog

asked on

PHP5 configure options ignored

I had a previous problem with this 64-bit FC2 OS on an Dual AMD64 that was resolved https://www.experts-exchange.com/questions/21167389/PHP5-Install-Problems-libphp5-so-not-created-on-AMD64.html and now a new problem has arisen with libphp5.so not being created when other configuration options are passed.

When I run configure with just this command:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs
then edit 'libtool' to include the lib64 directories as per bug http://bugs.php.net/bug.php?id=27795

Run make and make install, PHP5 works fine and creates the libphp5.so file.

If I expand the configure command to include any other option such as:
./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql

(I have also tried a number of other options) , then do the same steps for bypassing the bug 27795 and run make and make install, then the libphp5.so file is NOT created and the install fails.

It also totally ignores options such as 'with-mysql' as the config.cache file does not contain any lines such as:
ac_cv_lib_mysqlclient_mysql_close=${ac_cv_lib_mysqlclient_mysql_close=yes}

Stumped I am.

Thanks in advance!
Avatar of hernst42
hernst42
Flag of Germany image

You should not need the --with-mysql as this extension is build per default. What you can try is to build other php-modules as extensions.
if you ar capable of make and make install (and php works) go to the ext-dir in the source
cd mysql
/usr/local/php5/bin/phpize
./configure --with-mysql=shared
make

Does this work?
silly question: do have apache-devel installed?
Avatar of flumpydog
flumpydog

ASKER

Apache was installed from source distributions and not rpms
Ok, I ran phpize without much luck. Runs fine on the 32-bit box but does not create the .so file on the 64-bit platform. Good suggestion tho!

Below is the whole output:
[root@flumpy mysql]# /usr/local/php5/bin/phpize
Configuring for:
PHP Api Version:         20031224
Zend Module Api No:      20040412
Zend Extension Api No:   220040412
configure.in:9: warning: underquoted definition of PHP_WITH_PHP_CONFIG
  run info '(automake)Extending aclocal'
  or see http://sources.redhat.com/automake/automake.html#Extending%20aclocal
configure.in:32: warning: underquoted definition of PHP_EXT_BUILDDIR
configure.in:33: warning: underquoted definition of PHP_EXT_DIR
configure.in:34: warning: underquoted definition of PHP_EXT_SRCDIR
configure.in:35: warning: underquoted definition of PHP_ALWAYS_SHARED
config.m4:5: warning: underquoted definition of MYSQL_LIB_CHK
config.m4:15: warning: underquoted definition of PHP_MYSQL_SOCKET_SEARCH
acinclude.m4:19: warning: underquoted definition of PHP_PROG_RE2C
acinclude.m4:1903: warning: underquoted definition of PHP_TEST_BUILD
/usr/share/aclocal/vorbis.m4:9: warning: underquoted definition of XIPH_PATH_VORBIS
/usr/share/aclocal/pkg.m4:5: warning: underquoted definition of PKG_CHECK_MODULES
/usr/share/aclocal/ogg.m4:8: warning: underquoted definition of XIPH_PATH_OGG
/usr/share/aclocal/libmikmod.m4:11: warning: underquoted definition of AM_PATH_LIBMIKMOD
[root@flumpy mysql]# ./configure --with-mysql=shared
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
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 ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
./configure: line 1: php-config: command not found
configure: error: Cannot find php-config. Please use --with-php-config=PATH
[root@flumpy mysql]# ls -la
total 1560
drwxr-xr-x   6 flumpy flumpy   4096 Oct 15 07:13 .
drwxr-xr-x  83 flumpy flumpy   4096 Oct 15 07:12 ..
-rwxr-xr-x   1 root    root     48381 Oct 15 07:13 acinclude.m4
-rw-r--r--   1 root    root    209070 Oct 15 07:13 aclocal.m4
drwxr-xr-x   2 root    root      4096 Oct 15 07:13 autom4te.cache
drwxr-xr-x   2 root    root      4096 Oct 15 07:13 build
-rwxr-xr-x   1 root    root     42037 Oct 15 07:13 config.guess
-rw-r--r--   1 root    root      1610 Oct 15 07:13 config.h.in
-rw-r--r--   1 root    root      7742 Oct 15 07:13 config.log
-rw-r--r--   1 flumpy flumpy   3686 Dec 31  2003 config.m4
-rwxr-xr-x   1 root    root        82 Oct 15 07:13 config.nice
-rwxr-xr-x   1 root    root     30221 Oct 15 07:13 config.sub
-rwxr-xr-x   1 root    root    657967 Oct 15 07:13 configure
-rw-r--r--   1 root    root      2231 Oct 15 07:13 configure.in
-rw-r--r--   1 flumpy flumpy    481 Dec  4  2003 config.w32
-rw-r--r--   1 flumpy flumpy     46 Aug 20  2002 CREDITS
drwxr-xr-x   2 root    root      4096 Oct 15 07:13 include
-rw-r--r--   1 root    root         0 Oct 15 07:13 install-sh
-rw-r--r--   1 root    root    183730 Oct 15 07:13 ltmain.sh
-rw-r--r--   1 root    root         0 Oct 15 07:13 Makefile.fragments
-rwxr-xr-x   1 root    root      3100 Oct 15 07:13 Makefile.global
-rw-r--r--   1 root    root         0 Oct 15 07:13 Makefile.objects
-rw-r--r--   1 root    root         0 Oct 15 07:13 missing
-rw-r--r--   1 root    root         0 Oct 15 07:13 mkinstalldirs
-rw-r--r--   1 flumpy flumpy   8617 Jan 17  2004 mysql.dsp
-rw-r--r--   1 flumpy flumpy   4438 Jan  6  2003 mysql.mak
-rw-r--r--   1 flumpy flumpy   1876 Mar 23  2004 package.xml
-rw-r--r--   1 flumpy flumpy  70620 Jun  4 08:26 php_mysql.c
-rw-r--r--   1 flumpy flumpy   3732 Jan  8  2004 php_mysql.h
-rw-r--r--   1 root    root    226992 Oct 15 01:49 php_mysql.lo
drwxr-xr-x   2 flumpy flumpy   4096 Sep 23 14:26 tests

[root@flumpy mysql]# ./configure --with-mysql=shared --with-php-config=/usr/local/php5/bin/php-config
checking build system type... x86_64-redhat-linux-gnu
checking host system type... x86_64-redhat-linux-gnu
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 ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr/local/php5
checking for PHP includes... -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/M
checking for PHP extension directory... /usr/local/php5/lib/php/extensions/no-debug-non-zts-20040412
checking for re2c... exit 0;
checking for gawk... gawk
checking for MySQL support... yes, shared
checking for specified location of the MySQL UNIX socket... no
checking for the location of libz... no
checking for MySQL UNIX socket location... /var/lib/mysql/mysql.sock
checking for mysql_close in -lmysqlclient... no
checking for mysql_errno in -lmysqlclient... no
configure: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.
[root@flumpy mysql]# mv Makefile.global Makefile
[root@flumpy mysql]# make

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
just thought I would also mention that I do realize that I could have left out the --with-mysql option and perhaps it was a bad example. Just wanted to show what I was up against with configure having problems with other options when included with the apxs option and not creating the libphp5.so file as well as ignoring the other command options. :(
hmm, this sound like you have either a buggy ./configure or a buggy config file for it
resolved the problem, more of an issue with it looking for things in the wrong place. One example lib instead of lib64
nobody was able to help me with this, i resolved it myself and made the comment it was resolved. Not sure what the procedure it to close out a question in a case like this?
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial