# pdo_mysql installation error



## ibarmaley (Nov 16, 2011)

Hi. I stucked with php-pdo_mysql installation. 
	
	



```
cd /usr/ports/databases/php-pdo_mysql
make install clean

===>  Building for php5-pdo_mysql-5.3.8
/bin/sh /usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/libtool --mode=compile cc -I/usr/local/include/php/ext -I -I.
 -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql -DPHP_ATOM_INC
 -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/include
 -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/main -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql
 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend
 -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -O2 -pipe -fno-strict-aliasing  
 -c /usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c -o mysql_statement.lo
 cc -I/usr/local/include/php/ext -I -I. -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql -DPHP_ATOM_INC
 -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/include
 -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/main
 -I/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql -I/usr/local/include/php -I/usr/local/include/php/main
 -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
 -DHAVE_CONFIG_H -O2 -pipe -fno-strict-aliasing -c /usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c
 -fPIC -DPIC -o .libs/mysql_statement.o
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c: In function 'pdo_mysql_stmt_execute_prepared_libmysql':
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:145: error: 'MYSQL_BIND' undeclared (first use in this function)
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:145: error: (Each undeclared identifier is reported only once
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:145: error: for each function it appears in.)
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:166: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:187: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:187: error: 'MAX_MEDIUMINT_WIDTH' undeclared (first use in this function)
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:190: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:190: error: 'MAX_INT_WIDTH' undeclared (first use in this function)
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:193: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:193: error: 'MAX_BIGINT_WIDTH' undeclared (first use in this function)
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:196: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:196: error: 'MAX_TINYINT_WIDTH' undeclared (first use in this function)
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:199: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:199: error: 'MAX_SMALLINT_WIDTH' undeclared (first use in this function)
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:202: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:206: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:206: error: 'pdo_mysql_db_handle' has no member named 'max_buffer_size'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:207: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:207: error: 'pdo_mysql_db_handle' has no member named 'max_buffer_size'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:215: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:216: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:221: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:221: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:222: error: 'MYSQLND_PARAM_BIND' has no member named 'is_null'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:223: error: 'MYSQLND_PARAM_BIND' has no member named 'length'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:224: error: 'MYSQLND_PARAM_BIND' has no member named 'buffer_type'
/usr/ports/databases/php5-pdo_mysql/work/php-5.3.8/ext/pdo_mysql/mysql_statement.c:227: warning: passing argument 2 of
 'S->stmt->m->bind_result' from incompatible pointer type
*** Error code 1
*** Error code 1

Stop in /usr/ports/databases/php5-pdo_mysql.
*** Error code 1

Stop in /usr/ports/databases/php5-pdo_mysql.
```
I found a patch to php pdo_mysql 5.3.3. But I have php 5.3.8
Please, anybody help)


----------



## ibarmaley (Nov 16, 2011)

After long-long searching time, found solution: file /usr/ports/databases/php5-pdo_mysql/work/php-5.3.4/ext/pdo_mysql/mysql_statement.c - line 134 for php 5.3.4. In my case of php 5.3.8 the line number with this statement is another, but replacing works fine. pdo_mysql successfuly installed.

```
#ifdef HAVE_MYSQL_STMT_PREPARE
```
replace with

```
#ifndef PDO_USE_MYSQLND
```


----------

