Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compiling php 4.3.6 with mysql 4.0.18

Status
Not open for further replies.

axman505

Technical User
Joined
Jun 20, 2001
Messages
489
Location
US
I just upgraded my mysql installion, and i went to recompile my php installiong but now i am getting the following errors:

li.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lcrypt -lcrypt -lpq -lmysqlclient -lresolv -lm -ldl -lnsl -lcrypt -lcrypt -o sapi/cli/php
ext/mysql/php_mysql.lo: In function `zif_mysql_create_db':
/home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1158: undefined reference to `mysql_create_db'
ext/mysql/php_mysql.lo: In function `zif_mysql_drop_db':
/home/aaron/php-4.3.6/ext/mysql/php_mysql.c:1200: undefined reference to `mysql_drop_db'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


any suggestions?
 
PHP configure string:

./configure --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-pgsql=/usr/local/pgsql --with-gettext


Mysql Configure String
./configure --prefix=/usr/local/mysql --with-openssl=/usr/local/openssl
 
I assume, then, that you installed MySQL from source. As an aside, MySQL AB recommends that one install MySQL from binary. Yours isn't one of them, is it?

One thing I do differently....I generally have better success when I tell PHP's configure script "--with-mysql=/usr".

Have you successfully compiled PHP from source before using the configure options you've specified?



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I have compilied php several times using the same configure options. ONly when i upgraded mysql did i start getting that error.
 
From what version of MySQL did you upgrade? It may be that if your previous version was 3.x, PHP used its bundled libraries rather than any external code.



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I upgraded from 3.23.53
 
If the MySQL communications library were missing, the compile script would not complete. Could the MySQL library be damaged?



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
MySQL is up and running, should i try to recompile it?
 
I've never installed MySQL from source. Could there be some options to the configure script that is causing the problem? Did you install your previous version of MySQL from source, too?




As an aside, this warning from the MySQL downoads page:

Compiler Advisory: Several users have reported random crashes and table corruptions when using MySQL binaries compiled with gcc 2.96 on the x86 Linux platform. We suggest that you use gcc 2.95 or gcc 2.91 to compile your own binaries. It should also be safe to use gcc 3.2.

doesn't apply to you, does it?



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
My previous version was also installed from source.

I will check into the gcc thing, that could very well be it.
 
I am running version 3.2 of GCC
 
Isnt it recommended to specifiy a path with --with-mysql ??

Here is what i just did. i moved the current mysql install from /usr/local/mysql to /usr/local/mysql3

I compiled and installed mysql4 to /usr/local/mysql

However, i still get the same error during make.
 
When recompiling PHP, did you go through the entire "configure - make - make install" sequence?

Have you tried deleting config.cache and running "make clean"?



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Before every compile, i was running make clean and make distclean. I finally got fed up, and deleted the source folder, untared it again. And this time it finally worked.

Thanks everyone for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top