Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How do I add custom extensions when PHP is running?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Preparatory work

Dependent tool

This project is developed under MacOS, the tools involved are platform-independent, and should also be applicable to Linux and Windows desktop systems. Before starting this example, make sure that the following tools are installed correctly, updated to the latest version, and configured correctly.

DockerFun

The Fun and Fcli tools rely on docker to simulate the local environment.

For MacOS users, you can use homebrew to install:

Brew cask install dockerbrew tap vangie/formulabrew install funbrew install fcli

For Windows and Linux user installation, please refer to:

Https://github.com/aliyun/fun/blob/master/docs/usage/installation.mdhttps://github.com/aliyun/fcli/releases

After installation, remember to initialize the configuration by executing fun config first.

Note that if you have already installed fun, make sure that the fun version is above 3.6.1.

$fun-- version3.6.1PHP custom extension

Create a directory called extension in the function code directory and place the .ini and .so files corresponding to the extension in the extension directory. For example, the following is a custom extension of hello, assuming that there is a hello_world function in the extension:

. | _ extension | | _ hello.ini | | _ hello.so | _ main.php

Hello.ini

Extension=/code/extension/hello.so

Main.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report