https://github.com/p810/ext-hw
Hello world as a PHP extension
https://github.com/p810/ext-hw
Last synced: 9 months ago
JSON representation
Hello world as a PHP extension
- Host: GitHub
- URL: https://github.com/p810/ext-hw
- Owner: p810
- Created: 2019-03-03T23:37:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T13:59:44.000Z (over 7 years ago)
- Last Synced: 2025-04-11T20:11:27.673Z (about 1 year ago)
- Language: C
- Size: 1.95 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ext-hw
> Hello world as a PHP extension
## Installing
```bash
git clone https://github.com/p810/ext-hw.git
cd ext-hw/
phpize
./configure
make
```
After building the extension:
1. Copy `./modules/hello.so` to PHP's extensions directory
2. Add the following line to your `php.ini`:
- `extension = hello.so`
You can find the extension directory by running `php -i | grep extension_dir`, and `php.ini` with `php --ini`, respectively.
## API
### `hello_world(): string`
Returns a string containing "Hello world!"