Andrei, thank you so much for your patience and help. I finally got it built. However, I
cannot connect to my server with a simple test script:
[jshen@eduoutz ~]$ php mysqlicon.php
PHP Warning: mysqli::mysqli(): OK packet 6 bytes shorter than expected. PID=28749 in
/home/jshen/mysqlicon.php on line 2
Warning: mysqli::mysqli(): OK packet 6 bytes shorter than expected. PID=28749 in
/home/jshen/mysqlicon.php on line 2
PHP Warning: mysqli::mysqli(): mysqlnd cannot connect to MySQL 4.1+ using old
authentication in /home/jshen/mysqlicon.php on line 2
Warning: mysqli::mysqli(): mysqlnd cannot connect to MySQL 4.1+ using old authentication
in /home/jshen/mysqlicon.php on line 2
PHP Warning: mysqli::mysqli(): (00000/0): in /home/jshen/mysqlicon.php on line 2
Warning: mysqli::mysqli(): (00000/0): in /home/jshen/mysqlicon.php on line 2
PHP Warning: main(): Couldn't fetch mysqli in /home/jshen/mysqlicon.php on line 10
Warning: main(): Couldn't fetch mysqli in /home/jshen/mysqlicon.php on line 10
Host information:
PHP Warning: mysqli::close(): Couldn't fetch mysqli in /home/jshen/mysqlicon.php on line
13
Warning: mysqli::close(): Couldn't fetch mysqli in /home/jshen/mysqlicon.php on line 13
the script is what i used to connect through normal mysqli extension and worked fine
there:
<?php
$mysqli = new mysqli("localhost", "xxxx", "xxxxx", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
printf("Host information: %s\n", $mysqli->host_info);
/* close connection */
$mysqli->close();
?>
with mysqli (libmysql), it prints:
[jshen@eduoutx ~]$ php mysqlicon.php
Host information: Localhost via UNIX socket
mysql server is 5.1.21
John Shen 510-326-8473 Fax: 510-987-9612
System Coordinator, Online Information System
Student Affairs, University of California, Office of the President
________________________________
From: Andrey Hristov [mailto:andrey@stripped]
Sent: Fri 9/28/2007 11:41
To: John Shen
Cc: php@stripped
Subject: Re: php 5.2.4 with php mysql native driver failed to configure - unknown
configure option --enable-mysqlnd
Hi John,
John Shen wrote:
> andrey, ah, the INSTALL file in php5/ext/mysqli from the trunk still says using
> --enable-mysqlnd after --with-mysqli
>
> svn co http://svn.mysql.com/svnpublic/php-mysqlnd/trunk
>
> rm -fr /opt/backup/src/php-5.2.4/ext/mysqli
>
> mv /opt/backup/src/mysqlnd/trunk/php5/ext/mysqli /opt/backup/src/php-5.2.4/ext/
>
> ./buildconf --force
>
> ./configure --with-mysqli=mysqlnd
>
> this completed without problems.
>
> anyway, after changing configure to use --with-mysqli=mysqlnd, configure no longer
> has errors, but make now has a bunch of errors. it seems that it is looking for mysql
> header files, which are no longer in the include path in the make file generated by the
> new configure script, it seems.
>
> -I/opt/backup/src/php-5.2.4/TSRM -I/opt/backup/src/php-5.2.4/Zend -I/usr/include
> -g -O2 -c /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c -o ext/mysqli/mysqli.lo
> In file included from /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:31:
> /opt/backup/src/php-5.2.4/ext/mysqli/php_mysqli_structs.h:43:19: error: mysql.h: No
> such file or directory
> /opt/backup/src/php-5.2.4/ext/mysqli/php_mysqli_structs.h:44:20: error: errmsg.h: No
> such file or directory
> In file included from /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:31:
> /opt/backup/src/php-5.2.4/ext/mysqli/php_mysqli_structs.h:82: error: expected
> specifier-qualifier-list before 'MYSQL_STMT'
> /opt/backup/src/php-5.2.4/ext/mysqli/php_mysqli_structs.h:89: error: expected
> specifier-qualifier-list before 'MYSQL'
> /opt/backup/src/php-5.2.4/ext/mysqli/php_mysqli_structs.h:133: error:
> 'LOCAL_INFILE_ERROR_LEN' undeclared here (not in a function)
> /opt/backup/src/php-5.2.4/ext/mysqli/php_mysqli_structs.h:185: error: expected ')'
> before '*' token
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c: In function
> 'php_mysqli_persistent_on_rshut':
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:78: error: 'MYSQL' undeclared (first
> use in this function)
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:78: error: (Each undeclared identifier
> is reported only once
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:78: error: for each function it appears
> in.)
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:78: error: 'mysql' undeclared (first
> use in this function)
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:87: error: expected expression before
> ')' token
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c: In function
> 'php_mysqli_dtor_p_elements':
> /opt/backup/src/php-5.2.4/ext/mysqli/mysqli.c:103: error: 'MYSQL' undeclared (first
> use in this function)
> .
> .
> .
> .
You had to copy also trunk/mysqlnd into ext/ not just php5/ext/mysqli
Regards,
Andrey
--
Andrey Hristov, Connectors Software Developer
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Kaj Arnö - HRB München 162140