Home >php教程 >php手册 >PHP编译安装中遇到的两个错误和解决方法,php编译

PHP编译安装中遇到的两个错误和解决方法,php编译

WBOY
WBOYOriginal
2016-06-13 09:26:501261browse

PHP编译安装中遇到的两个错误和解决方法,php编译

一、PHP configure: error: Cannot find ldap libraries in /usr/lib

今天在CentOS 64位下编译安装PHP5.4.8。结果在configure的时候提示
configure: error: Cannot find ldap libraries in /usr/lib
提示在/usr/lib 下找不到相关模块,这是因为64位的linux默认把以上文件都存在 /usr/lib64 文件夹下。

解决方法:

复制代码 代码如下:


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

重新configure即可

二、PDO_MYSQL make: *** [pdo_mysql.lo] Error 1

编译安装PDO_MYSQL拓展模块,总是提示:

复制代码 代码如下:


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

这是因为这是因为在编译时需要 MySQL 的头的文件。而它按默认搜索找不到头文件的位置,所以才出现这个问题。通过软连接把MySQL头文件对应到/usr/local/include/下就好
比如你的MySQL安装文件位于/usr/local/mysql,那么就执行以下命令:

复制代码 代码如下:


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

php安装,解压过后编译时出现如下,

因为你的系统里面是Apache2,那么参数中的下面部分:
--with-apxs=/usr/local/apache/bin/apxs

应该修改为:
--with-apxs2=/usr/local/apache/bin/apxs
 

我配置过PHP开发环境之后,为何不可以对php文件进行编译,localhost之后还是原文件显示,如下图

php没有成功和解析器连接
 

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