PHP 5.1 and 5.2 and MySQL 5.1.20+

Today I fell victim of a gotcha when custom compiling PHP 5.1.4 for a customer which runs MySQL 5.1.22. The customer in question requires the mysqli component which appears to be broken with these versions (fixed in 5.2.4 though). So if you configure PHP with --with-mysqli=/usr/bin/mysql_config enabled you will soon find yourself staring at:

/usr/local/src/php-5.1.4/ext/mysqli/mysqli_api.c: In function 'zif_mysqli_stmt_bind_param':
/usr/local/src/php-5.1.4/ext/mysqli/mysqli_api.c:145: error: 'gptr' undeclared (first use in this function)
/usr/local/src/php-5.1.4/ext/mysqli/mysqli_api.c:145: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.1.4/ext/mysqli/mysqli_api.c:145: error: for each function it appears in.)
/usr/local/src/php-5.1.4/ext/mysqli/mysqli_api.c: In function 'zif_mysqli_stmt_execute':
/usr/local/src/php-5.1.4/ext/mysqli/mysqli_api.c:601: error: 'gptr' undeclared (first use in this function)

To fix this, either upgrade to 5.2.4, or if you’re left with no choice such as myself edit php-5.1.4/ext/mysqli/mysqli_api.c and replace all occurrances of gptr with char*

That ought to get you through the rest of the compilation provided that you’ve got the rest of your setup correct.

About Erik Ljungstrom

I'm Erik Ljungstrom and I work in a datacenter as a technical team leader. In this blog I will mostly jot down things I consider noteworthy things I encounter in my work. For more information, please see http://northernmost.org
This entry was posted in php, Webservers and tagged , , , , . Bookmark the permalink.

4 Responses to PHP 5.1 and 5.2 and MySQL 5.1.20+

  1. ايفون says:

    Hello ,
    I think the most stable PHP and Mysql Versions is PHP 5.2.10 and MySQL 5.2.10

  2. PHP 5.2.10 and PHP 5.3.0 are stable, and MySQL 5.1.38, but it’s a bit irrelevant at the moment as this post is going on 6 months old by now.

  3. Barnaby Puttick says:

    You star, thank you!

  4. Scott Rowley says:

    Excellent, exactly what I needed. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>