PHP扩展生成器
第一种方法:使用PHP源码包自带的ext_skel工具。
~/public_html/php-5.3.13/ext> ./ext_skel --extname=sample11
Creating directory sample11
Creating basic files: config.m4 config.w32 .svnignore sample11.c php_sample11.h CREDITS EXPERIMENTAL tests/001.phpt sample11.php [done].
To use your new extension, you will have to execute the following steps:
1. $ cd ..
2. $ vi ext/sample11/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-sample11
5. $ make
6. $ ./php -f ext/sample11/sample11.php
7. $ vi ext/sample11/sample11.c
8. $ make
Repeat steps 3-6 until you are satisfied with ext/sample11/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.
第二种方法:使用CodeGen_PECL。
/usr/local/services/php/bin> sudo ./pear install CodeGen_PECL
downloading CodeGen_PECL-1.1.3.tgz ...
Starting to download CodeGen_PECL-1.1.3.tgz (102,640 bytes)
........................done: 102,640 bytes
install ok: channel://pear.php.net/CodeGen_PECL-1.1.3
/usr/local/services/php/bin> sudo ln -s /usr/local/services/php/bin/pecl-gen /usr/local/bin/
~/public_html/php-5.3.13/ext> pecl-gen --extname=sample12
Strict Standards: Declaration of CodeGen_PECL_Element_Constant::docFooter() should be compatible with that of CodeGen_Element::docFooter() in /usr/local/services/php/lib/php/CodeGen/PECL/Element/Constant.php on line 341
Strict Standards: Declaration of CodeGen_PECL_Element_Resource::hCode() should be compatible with that of CodeGen_Element::hCode() in /usr/local/services/php/lib/php/CodeGen/PECL/Element/Resource.php on line 354
Strict Standards: Declaration of CodeGen_PECL_Element_Ini::docFooter() should be compatible with that of CodeGen_Element::docFooter() in /usr/local/services/php/lib/php/CodeGen/PECL/Element/Ini.php on line 443
Strict Standards: Declaration of CodeGen_PECL_Element_Logo::hCode() should be compatible with that of CodeGen_Element::hCode() in /usr/local/services/php/lib/php/CodeGen/PECL/Element/Logo.php on line 259
Strict Standards: Declaration of CodeGen_PECL_Element_Method::setCode() should be compatible with that of CodeGen_PECL_Element_Function::setCode() in www.2cto.com/usr/local/services/php/lib/php/CodeGen/PECL/Element/Method.php on line 471
Strict Standards: Declaration of CodeGen_PECL_Element_Stream::hCode() should be compatible with that of CodeGen_Element::hCode() in /usr/local/services/php/lib/php/CodeGen/PECL/Element/Stream.php on line 239
Your extension has been created in directory ./sample12.
See ./sample12/README and/or ./sample12/INSTALL for further instructions.
注:报错“Strict Standards: Declaration of […] should be compatible with that of […] in […]”是因为PHP5.3.0+要求子类声明必须在父类声明,请直接修改php.ini。
error_reporting = E_ALL & ~E_STRICT
以上只是给出了生成PHP扩展的最简单的命令,ext_skel和pecl-gen还支持多种参数生成更加丰富的扩展,请自行参考相关帮助文档。
~/public_html/php-5.3.13/ext> ./ext_skel --help
~/public_html/php-5.3.13/ext> pecl-gen --help

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

Configure the apscheduler timing task as a service on macOS platform, if you want to configure the apscheduler timing task as a service, similar to ngin...

How to replace the disabled initialize_agent function in LangChain? In the LangChain library, initialize_agent...

Alternative usage of Python parameter annotations In Python programming, parameter annotations are a very useful function that can help developers better understand and use functions...

Regarding the problem of removing the Python interpreter that comes with Linux systems, many Linux distributions will preinstall the Python interpreter when installed, and it does not use the package manager...

This article describes how to build a highly available MongoDB database on a Debian system. We will explore multiple ways to ensure data security and services continue to operate. Key strategy: ReplicaSet: ReplicaSet: Use replicasets to achieve data redundancy and automatic failover. When a master node fails, the replica set will automatically elect a new master node to ensure the continuous availability of the service. Data backup and recovery: Regularly use the mongodump command to backup the database and formulate effective recovery strategies to deal with the risk of data loss. Monitoring and Alarms: Deploy monitoring tools (such as Prometheus, Grafana) to monitor the running status of MongoDB in real time, and

This article introduces a variety of methods and tools to monitor PostgreSQL databases under the Debian system, helping you to fully grasp database performance monitoring. 1. Use PostgreSQL to build-in monitoring view PostgreSQL itself provides multiple views for monitoring database activities: pg_stat_activity: displays database activities in real time, including connections, queries, transactions and other information. pg_stat_replication: Monitors replication status, especially suitable for stream replication clusters. pg_stat_database: Provides database statistics, such as database size, transaction commit/rollback times and other key indicators. 2. Use log analysis tool pgBadg
