Page 1 of 1

Configure PHP 5.0.1 under Solaris 9

Posted: Sat Sep 18, 2004 4:58 am
by bluenote
Hi 8) alltogether,

i have a server running with the following configuration:
  • Sun Solaris 9 (SPARC)
    Apache 1.3.29
    PHP 4.3.4
    MySQL 4.0.18-standard
It's performing quite well. Yesterday, i started to upgrade PHP (to Vers. 5.0.1) & MySQL (to Vers. 4.1.4).

The MySQL upgrade worked fine, and i am able to acces the server both via MyAdmin & command line. I added my users and databases, started it, stopped it...

Then i started upgrading PHP:

Code: Select all

bash-2.05# cd /export/home/local/src
bash-2.05# ls -l
total 3728570
drwxr-xr-x 106 root     other       2560 Aug 27 22:51 9_Recommended
-rwxr--r--   1 root     root     136350041 Aug 31 10:18 9_Recommended.zip
...
...
...
-rwxr--r--   1 root     root     5619589 Sep 10 08:33 php-5.0.1.tar.gz

bash-2.05# ps -eal | grep mysql
 8 S     0   310     1  0  40 20        ?    141        ? ?        0:00 mysqld_s
 8 S   100   333   310  0  40 20        ?   4319        ? ?        0:47 mysqld
bash-2.05# kill -9 310 333

bash-2.05# ps -eal | grep httpd
 8 S 60001   362   297  0  40 20        ?   2053        ? ?        0:07 httpd
 8 S     0   297     1  0  40 20        ?   1526        ? ?        0:00 httpd
 8 S 60001   302   297  0  40 20        ?   2038        ? ?        0:05 httpd
 8 S 60001   303   297  0  40 20        ?   2019        ? ?        0:03 httpd
 8 S 60001   304   297  0  40 20        ?   2051        ? ?        0:07 httpd
 8 S 60001   305   297  0  40 20        ?   1974        ? ?        0:04 httpd
 8 S 60001   306   297  0  40 20        ?   2041        ? ?        0:08 httpd
 8 S 60001   363   297  0  40 20        ?   2034        ? ?        0:04 httpd
bash-2.05# kill -9 297 362 302 303 304 305 306 363

bash-2.05# gunzip < php-5.0.1.tar.gz | /usr/local/bin/tar xovf -
bash-2.05# cd php-5.0.1
bash-2.05# export CC=/usr/local/bin/gcc
bash-2.05# export LDFLAGS="-L/usr/lib -L/usr/local -L/usr/local/lib -L/usr/local/mysql/lib -L/usr/local/ssl/lib -L/usr/local/lib/sasl2"
bash-2.05# export CPPFLAGS="-I/usr/include -I/usr/local/include -I/usr/local/mysql/include -I/usr/local/apache/include"
bash-2.05# export PATH=/usr/sbin:/usr/bin:/usr/lib/nis:/usr/local/bin:/usr/ccs/bin:/usr/local/apache/bin/apxs:/usr/local/mysql/bin:/usr/local/mysql/bin/mysql_config

bash-2.05# ./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-ssl=/usr/local/ssl --with-cyrus-sasl --with-zlib-dir=/usr/local/include --with-gd --with-jpeg-dir=/usr/local/lib --enable-gd-native-ttf --enable-gd-jis-conv --with-curl=/usr/local/include/curl --with-curlwrappers

creating cache ./config.cache
checking host system type... sparc-sun-solaris2.9
checking for gcc... /usr/local/bin/gcc
checking whether the C compiler (/usr/local/bin/gcc  -L/usr/lib -L/usr/local -L/usr/local/lib -L/usr/local/mysql/lib -L/usr/local/ssl/lib -L/usr/local/lib/sasl2) works... yes
checking whether the C compiler (/usr/local/bin/gcc  -L/usr/lib -L/usr/local -L/usr/local/lib -L/usr/local/mysql/lib -L/usr/local/ssl/lib -L/usr/local/lib/sasl2) is a cross-compiler... no
checking whether we are using GNU C... yes
...
...
...

Configuring SAPI modules
...
...
...

Running system checks
...
...
...

General settings
...
...
...

Configuring extensions
...
...
...

checking for MySQL support... no
checking for specified location of the MySQL UNIX socket... no
checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check config.log for more information.
Have i forgot something?

Greez,
- bluenote

Posted: Sat Sep 18, 2004 5:03 am
by bluenote
Here's what config.log says:

Code: Select all

bash-2.05# cat config.log

configure:53849: checking for MySQL support
configure:53895: checking for specified location of the MySQL UNIX socket
configure:54924: checking for MySQLi support
configure:54970: checking whether to enable embedded MySQLi support
configure:55103: checking for mysql_set_server_option in -lmysqlclient
configure:55122: /usr/local/bin/gcc -o conftest -g -O2 -I/usr/include -I/usr/local/include -I/usr/local/mysql/include -I/usr/local/apache/include -D_POSIX_PTHREAD_SEMANTICS -R/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/lib -L/usr/local -L/usr/local/lib -L/usr/local/mysql/lib -L/usr/local/ssl/lib -L/usr/local/lib/sasl2 -R/usr/ucblib -L/usr/ucblib -R/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2 -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2 -R/usr/local/lib -L/usr/local/lib -R/usr/openwin/lib -L/usr/openwin/lib -R/usr/local/ssl/lib -L/usr/local/ssl/lib -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm conftest.c -lmysqlclient  -lpng -lz -ljpeg -lcurl -lz -lresolv -lm -ldl -lnsl -lsocket  -lgcc -lxml2 -lz -liconv -lm -lsocket -lnsl -lcurl -lz -lssl -lcrypto -ldl -lsocket -lnsl -lxml2 -lz -liconv -lm -lsocket -lnsl 1>&5
ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(libmysql.o): wrong ELF class: ELFCLASS64
Undefined                       first referenced
 symbol                             in file
mysql_set_server_option             /var/tmp//cc2SpwA0.o
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 55111 "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 mysql_set_server_option();

int main() &#123;
mysql_set_server_option()
; return 0; &#125;

Posted: Sun Sep 19, 2004 5:02 am
by bluenote
I just reviewed the php.net Bug list and found

http://bugs.php.net/bug.php?id=29537

Bug #29537 PHP Configure fails with "mysql configure failed" when trying to use 64bit libs

This is exactly my problem.