Re: MYSQL_VERSION_ID?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Thus wrote Minuk Choi:
> I've a Redhat9 and installed MySQL 4.0 from source and Apache 1.3 from source.

>From my expirence, at this  point you probably have 2 versions of
mysql and 2 versions of apache on your system.

Your new versions, depending on how you compile them will default
to the paths of:

  /usr/local/mysql/
  /usr/local/apache/

The default installations will be spread accross:
  /etc/*
  /usr/include/*
  /usr/lib/*
  ...

> I also downloaded the PHP5.0.2 source and attempted to compile it.
> 
> Apache and MySQL are installed successfully, as they all work without any noticeable errors.
> 
> 
> This is how I configured PHP5
> 
> ./configure --prefix=/PHP5 --with-mysql=<mysql path> 

what exactly is that mysql path you issue?

> 
> when I ran "make", I got an error.  It was regarding one of the functions, make tried to compile mysql_create_db and mysql_drop_db(functions that are no longer provided by the MySQL4.0 client).

If this is the case then the configuration of php picked up the
headers for the  old version of mysql, but the libraries that php
tried to use where mysql4. Causing the errors. If you provide the
exact errors you got when compiling, it might be insightful.

> 
> When I checked the source code(the c and h files), there was this line,
> 
> #if MYSQL_VERSION_ID < 40000
> 
> which was enclosed in the declaration of the function prototypes
> 
> PHP_FUNCTION(mysql_create_db)
> PHP_FUNCTION(mysql_drop_db)
> 
> in php_mysql.h
> 
> and also around the implemention of the functions
> 
> PHP_FUNCTION(mysql_create_db)
> PHP_FUNCTION(mysql_drop_db)
> 
> in php_mysql.c

This is correct behaviour.

> 
> The problem I seem to have is that MYSQL_VERSION_ID is never defined?  Perhaps this is due to the fact that I compiled MySQL 4.0 from source and may have skipped a step... but where is MYSQL_VERSION_ID supposed to be defined or retrieved?  
> 
> typing 
> 
> echo $MYSQL_VERSION_ID
> 
> in bash got me a blank line.

the #if MYSQL_VERSION_ID is not defined in your environment but in
the header file of mysql_version.h

if at your shell prompt you type:
  locate mysql_version.h

You should get a minimum of 2 or possibly 3 files resulted:
  /path/to/php/src/ext/mysql/libmysql/mysql_version.h
  /usr/local/mysql/include/mysql_version.h
  /usr/include/mysql_version.h

That is where MYSQL_VERSION_ID is defined.

> 
> I managed to comment out those functions in the header and the c files and "make" and "make install" ran flawlessly.

This may work, but dont expect mysql_thread_id() to work and you
might run into other side effects depending on what version php is
thinking mysql is.

> 
> Could this be a bug?

Doesn't look like it.


Curt
-- 
The above comments may offend you. flame at will.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux