search
Homephp教程php手册phpize常见问题说明
phpize常见问题说明Jun 13, 2016 am 10:53 AM
peclwithcommon problemillustrate

Compiling shared PECL extensions with phpize

 

Sometimes, using the pecl installer is not an option. This could be because you're behind a firewall, or it could be because the extension you want to install is not available as a PECL compatible package, such as unreleased extensions from SVN. If you need to build such an extension, you can use the lower-level build tools to perform the build manually.

 

The phpize command is used to prepare the build environment for a PHP extension. In the following sample, the sources for an extension are in a directory named extname:

 

$ cd extname  进入到源码包中的扩展目录

$ phpize  运行phpize。路径不一定在当前目录下,去寻找phpize运行。之后会生成了一个configure文件

$ ./configure     运行。    如果生成基于数据库的扩展,需要加上参数运行:1,--with-php-config。2,"--with-具体的数据库参数".比如, --with-pgsql、--with-mysql

$ make

# make install 将会生成一个extname.so的扩展,被放到了PHP extensions directory

 

 

A successful install will have created extname.so and put it into the PHP extensions directory. You'll need to and adjust php.ini and add an extension=extname.so line before you can use the extension.

 

If the system is missing the phpize command, and precompiled packages (like RPM's) are used, be sure to also install the appropriate devel version of the PHP package as they often include the phpize command along with the appropriate header files to build PHP and its extensions.

 

Execute phpize --help to display additional usage information.

 

 

phpize的作用可以这样理解:侦测环境(phpize工具是在php安装目录下,所以是要根据该php的配置情况生成对应的configure文件),建立一个configure文件。必须在一个目录下去运行phpize。那么phpize就知道你的的环境是哪个目录,并且configure文件建立在该目录下。

步骤总结:

一、cd /usr/src/php源码包目录/ext/扩展目录/  

 

二、/usr/local/php5314/bin/phpize

三、./configure --with-php-config=/usr/local/php5314/bin/php-config

注:xampp安装的话默认用 ./configure --with-php-config=/opt/lampp/bin/php-config

 

四、make && make install

 

五、剩下是配置php.ini

 

 

假如你的服务器上安装了多个版本php,那么需要告诉phpize要建立基于哪个版本的扩展。通过使用--with-php-config=指定你使用哪个php版本。

 

比如:--with-php-config=/usr/local/php524/bin/php-config  

 

关于php-config文件:是在php编译生成后(安装好),放在安装目录下的一个文件。

 疑问:phpize是在php安装目录下的一个文件。比如我安装了两个php5.2 和php5.3那么使用phpize也要使用对应版本的phpize才行吧,此时使用--with-php-config有什么作用?

phpize工具一般在哪里?

当php编译完成后,php安装目录下的bin目录下会有phpize这个脚本文件。所以是去安装好的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
赛博朋克2077的常见问题解析赛博朋克2077的常见问题解析Jan 05, 2024 pm 06:05 PM

最近一款超级火爆的游戏赛博朋克2077上线很多的用户都争先恐后的进行了下载体验,但是在这过程中还是有着很多的问题的,今天就给你们带来了玩赛博朋克2077常见问题,快来看看有没有要的吧。玩赛博朋克2077常见问题:一、价格详情:1、steam游戏平台的购买价格为:298元人民币。2、epic游戏平台的购买价格为:43美元=282元人民币。3、ps4游戏端的购买价格为:400元+HKD以及380元+RMB盒装。4、俄区俄罗斯的购买价格为:172元人民币。二、配置详情:1、最低配置(1080P):GT

PHP邮件发送方法及常见问题汇总PHP邮件发送方法及常见问题汇总Jun 08, 2023 pm 10:57 PM

在互联网时代,邮件已经成为人们生活、工作中不可或缺的一个部分。PHP作为一种广泛应用于Web开发领域的语言,邮件发送在Web应用中也是必不可少的。本文将详细介绍PHP邮件发送的相关内容和常见问题汇总。一、PHP邮件发送方法PHPmailer库PHPmailer是一种功能强大的PHP邮件发送类库,它可以轻松地发送HTML格式和纯文本格式的邮件。使用PHPmai

PHP数据分页方法及常见问题详解PHP数据分页方法及常见问题详解Jun 09, 2023 am 08:42 AM

一、前言随着数据处理的不断增多,数据分页成为了一个极其重要的功能。而PHP作为一门广泛应用于Web开发的语言,自然也会有自己的数据分页方法。本文就会对PHP数据分页方法和常见问题进行详细解析。二、PHP数据分页方法1.原始方法数据分页最简单的做法就是使用SQL语句的LIMIT子句,根据每一页需要显示的记录数和当前页码,计算出offset,在查询时添加

Go语言ORM框架常见问题解析Go语言ORM框架常见问题解析Jun 03, 2023 am 09:22 AM

在现代的Web应用中,使用ORM框架来处理数据库操作已经成为了标配。而在所有的ORM框架中,Go语言ORM框架是越来越受到开发者的关注和喜爱的。然而,当我们使用Go语言ORM框架时,我们可能会遇到一些常见的问题。在本文中,我们将会分析并解决这些常见问题,以便更好地使用Go语言ORM框架。关于GORM的数据模型定义在GORM中,我们可以使用struct定义数据

常见的MySQL锁问题及其解决方案常见的MySQL锁问题及其解决方案Dec 21, 2023 am 09:09 AM

MySQL锁的常见问题与解决方案MySQL是一种常用的关系型数据库管理系统,它使用锁来实现并发控制,保证数据的一致性和完整性。然而,MySQL锁的使用也会带来一些问题。本文将介绍一些常见的MySQL锁的问题,并提供相应的解决方案。死锁问题死锁是指两个或多个事务相互等待对方所占有的资源,从而导致进程无法继续执行。MySQL的InnoDB存储引擎

详解Css Flex 弹性布局中的常见问题及解决方案详解Css Flex 弹性布局中的常见问题及解决方案Sep 26, 2023 pm 01:19 PM

详解CSSFlex弹性布局中的常见问题及解决方案引言:CSSFlex弹性布局是一种现代的布局方式,其具有优雅简洁的语法和强大的灵活性,广泛应用于构建响应式的web页面。然而,在实际应用中,经常会遇到一些常见的问题,如元素排列不如预期、尺寸不一致等。本文将详细介绍这些问题,并提供相应的解决方案,代码示例如下。一、元素排列不如预期问题问题描述:在使用Flex

Go语言项目开发的常见问题与解决方法Go语言项目开发的常见问题与解决方法Nov 03, 2023 pm 01:55 PM

Go语言作为一种高性能、简洁易用的编程语言,越来越多的开发者开始选择它作为项目开发的首选语言。然而,在实际的项目开发过程中,我们也会遇到一些常见的问题。本文将介绍一些这样的问题,并提供相应的解决方法,帮助开发者更好地应对这些挑战。问题一:依赖管理在Go语言的项目开发中,依赖管理是一个常见的问题。由于Go语言的模块化特性,项目往往会依赖于许多第三方包和库。而如

Vue组件通讯的常见问题及解决方案Vue组件通讯的常见问题及解决方案Jul 17, 2023 pm 11:16 PM

Vue组件通讯的常见问题及解决方案在Vue应用开发中,组件通讯是一个非常重要的话题。不同组件之间的通讯可以帮助我们实现数据共享、状态管理以及事件传递等功能。然而,组件通讯也常常会遇到一些问题,如何解决这些问题是我们在开发中需要重点关注的。一、父组件向子组件传递数据一种常见的场景是父组件需要将数据传递给子组件。对于这种情况,我们可以使用属性绑定的方式进行传递。

See all articles

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 agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),