Table of Contents
PHP编译安装中遇到的两个错误和解决方法,php编译
php安装,解压过后编译时出现如下,
我配置过PHP开发环境之后,为何不可以对php文件进行编译,localhost之后还是原文件显示,如下图
Home php教程 php手册 PHP编译安装中遇到的两个错误和解决方法,php编译

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

Jun 13, 2016 am 09:26 AM
php php file Compile and install Solution mistake

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 of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

How to specify the version of the local package in pnpm and monorepo projects? How to specify the version of the local package in pnpm and monorepo projects? Apr 04, 2025 pm 04:06 PM

How to specify the version of local packages in pnpm and monorepo projects When managing projects using pnpm and monorepo, you often encounter the need to share local areas between projects...

Why does my RxJS code not take effect when operating on streams? Why does my RxJS code not take effect when operating on streams? Apr 04, 2025 pm 06:27 PM

Why doesn't my code take effect when using RxJS to operate on streams? Learning RxJS...

How to use XPath to search from a specified DOM node in JavaScript? How to use XPath to search from a specified DOM node in JavaScript? Apr 04, 2025 pm 11:15 PM

Detailed explanation of XPath search method under DOM nodes In JavaScript, we often need to find specific nodes from the DOM tree based on XPath expressions. If you need to...

What are the reasons and solutions for the server file that cannot be downloaded after sftp.json configuration? What are the reasons and solutions for the server file that cannot be downloaded after sftp.json configuration? Apr 04, 2025 pm 06:54 PM

Solution to the problem that the server file cannot be downloaded after SFTP.json configuration After configuring the sftp.json file, users may encounter the inability to download the target server file...

Element Plus table component max-height is invalid? How to make the table highly adaptable and display scrollbars? Element Plus table component max-height is invalid? How to make the table highly adaptable and display scrollbars? Apr 04, 2025 pm 04:03 PM

The ElementPlus table component max-height property invalidation and solution when using Element...

See all articles