php_pdo_mysql_int.h:31:20: fatal error: mysql.h: No such file or directory

While trying to compile PHP 5.5 with pdo support on Ubuntu 12 with the intention of trying out this Medoo framework, I was seeing the subject error.

In the PHP installation folder, I edited the file ext/pdo_mysql/php_pdo_mysql_int.h and I changed line 31 from
# include <mysql.h>
to
# include </usr/include/mysql/mysql.h>

I don’t know why that was required, but after that configure ran… but make gives
/usr/local/src/php-5.5.8/ext/pdo_mysql/mysql_driver.c:35:26: fatal error: mysqld_error.h: No such file or directory

argh…
OK I changed the PHP configure command from having
'--with-pdo-mysql=/usr/bin/mysql'
to just
'--with-pdo-mysql'

then PHP was able to compile and now ‘pdo_mysql’ is present in the phpinfo(), but Medoo is giving a new error… it doesn’t like that our db has old passwords, but I can’t update that now, so I will move on testing the next framework…

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to php_pdo_mysql_int.h:31:20: fatal error: mysql.h: No such file or directory

Leave a Reply

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