Two Errors and Solutions in PHP Compilation and Installation

  • 2021-07-13 04:50:33
  • OfStack

1. PHP configure: error: Cannot find ldap libraries in /usr/lib

PHP 5.4. 8 is compiled and installed today under CentOS 64-bit. The result is prompted when configure
configure: error: Cannot find ldap libraries in /usr/lib
Tip No module can be found under the/usr/lib, because 64-bit linux defaults to all of the above files under the/usr/lib64 folder.

Solution:


cp -frp /usr/lib64/libldap* /usr/lib/

Re-configure is enough

2. PDO_MYSQL make: *** [pdo_mysql.lo] Error 1

Compile and install the PDO_MYSQL extension module, always prompting:


In file included from /data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:
/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: error: mysql.h: No such file or directory
In file included from /data0/software/PDO_MYSQL-1.0.2/pdo_mysql.c:31:
/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36: error: expected specifier-qualifier-list before ' MYSQL'
/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48: error: expected specifier-qualifier-list before ' MYSQL_FIELD'
/data0/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53: error: expected specifier-qualifier-list before ' MYSQL_RES'
make: *** [pdo_mysql.lo] Error 1

This is because this is because the header file of MySQL is needed at compile time. And it can't find the location of the header file by default search, so this problem occurs. It is good to correspond the MySQL header file to/usr/local/include/through soft connection
If your MySQL installation file is located at/usr/local/mysql, then execute the following command:


# ln -s /usr/local/mysql/include/* /usr/local/include/


Related articles: