Home  >  Article  >  Backend Development  >  Two errors encountered during PHP compilation and installation and their solutions, php compilation_PHP tutorial

Two errors encountered during PHP compilation and installation and their solutions, php compilation_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:20:32960browse

Two errors encountered during PHP compilation and installation and their solutions, PHP compilation

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

Compile and install PHP5.4.8 under CentOS 64-bit today. The result is prompted
when configuring configure: error: Cannot find ldap libraries in /usr/lib
It prompts that the relevant modules cannot be found in /usr/lib. This is because 64-bit Linux stores the above files in the /usr/lib64 folder by default.

Solution:

Copy code The code is as follows:

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

Just reconfigure

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

When compiling and installing the PDO_MYSQL expansion module, it always prompts:

Copy code The code is as follows:

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 the MySQL header file is required at compile time. And it can't find the location of the header file by default, so this problem occurs. Just map the MySQL header file to /usr/local/include/ through a soft connection
For example, if your MySQL installation file is located in /usr/local/mysql, then execute the following command:

Copy code The code is as follows:

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

php installation, after decompression, the following will appear when compiling,

Because your system is Apache2, then the following part of the parameters:
--with-apxs=/usr/local/apache/bin/apxs

should be changed to:
--with-apxs2=/usr/local/apache/bin/apxs

After I configured the PHP development environment, why can’t I compile the php file? After localhost, the original file is still displayed, as shown below

php failed to successfully connect to the parser

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/866674.htmlTechArticleTwo errors encountered during PHP compilation and installation and their solutions, php compilation 1, PHP configure: error: Cannot find ldap libraries in /usr/lib Today I compiled and installed PHP5.4.8 under CentOS 64-bit. Knot...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn