Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

How can I bind OLSRT to PHP?

Hey Dev Community! After my last blog about binding OLSRT to Node.js, I’m back again—this time with a new challenge: How can I bind OLSRT to PHP? If you’ve ever wanted to bring async/event‑driven power into PHP, this post is for you. Let…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hey Dev Community!


After my last blog about binding OLSRT to Node.js, I’m back again—this time with a new challenge: How can I bind OLSRT to PHP?



If you’ve ever wanted to bring async/event‑driven power into PHP, this post is for you. Let’s dive in together!







🔧 Prerequisites



Before we start, make sure you have:





  • Knowledge: C programming and basic PHP internals (Zend API).


  • Tools:


    • On Windows: PHP SDK, Visual Studio (MSVC), Git.

    • On Linux/macOS: php-dev, phpize, GCC/Clang, Autotools, Git.




  • OLSRT repo cloned:



  git clone https://github.com/OverLab-Group/OLSRT









📂 Project Setup



Inside your project root, create:





  • php_olsrt.h — header file


  • php_olsrt.c — main binding code


  • config.m4 (Linux/macOS) or config.w32 (Windows) — build config


  • test.php — to test the extension



Also add include directories to compiler: OLSRT/src, OLSRT/includes, and Root Project.







📝 php_olsrt.h





#ifndef PHP_OLSRT_H
#define PHP_OLSRT_H

extern zend_module_entry olsrt_module_entry;
#define phpext_olsrt_ptr &olsrt_module_entry

#define PHP_OLSRT_EXTNAME "olsrt"
#define PHP_OLSRT_VERSION "0.1.0"

PHP_FUNCTION(olsrt_hello);
PHP_FUNCTION(olsrt_version);

#endif /* PHP_OLSRT_H */









📝 php_olsrt.c





#include "php.h"
#include
"php_ini.h"
#include
"ext/standard/info.h"
#include
"php_olsrt.h"
// #include "olsrt.h" // Uncomment when OLSRT headers are ready

PHP_FUNCTION(olsrt_hello)
{
php_printf("[OLSRT] Hello from PHP binding!\\n");
RETURN_TRUE;
}

PHP_FUNCTION(olsrt_version)
{
RETURN_STRING("OLSRT PHP binding 0.1.0 (stub)");
}

static const zend_function_entry olsrt_functions[] = {
PHP_FE(olsrt_hello, NULL)
PHP_FE(olsrt_version, NULL)
PHP_FE_END
};

PHP_MINIT_FUNCTION(olsrt) { return SUCCESS; }
PHP_MSHUTDOWN_FUNCTION(olsrt) { return SUCCESS; }
PHP_RINIT_FUNCTION(olsrt) { return SUCCESS; }
PHP_RSHUTDOWN_FUNCTION(olsrt) { return SUCCESS; }

PHP_MINFO_FUNCTION(olsrt)
{
php_info_print_table_start();
php_info_print_table_header(2, "OLSRT support", "enabled");
php_info_print_table_row(2, "Version", PHP_OLSRT_VERSION);
php_info_print_table_end();
}

zend_module_entry olsrt_module_entry = {
STANDARD_MODULE_HEADER,
PHP_OLSRT_EXTNAME,
olsrt_functions,
PHP_MINIT(olsrt),
PHP_MSHUTDOWN(olsrt),
PHP_RINIT(olsrt),
PHP_RSHUTDOWN(olsrt),
PHP_MINFO(olsrt),
PHP_OLSRT_VERSION,
STANDARD_MODULE_PROPERTIES
};

#ifdef COMPILE_DL_OLSRT
ZEND_GET_MODULE(olsrt)
#endif









⚙️ config.m4 (Linux/macOS)





PHP_ARG_ENABLE(olsrt, whether to enable OLSRT support,
[ --enable-olsrt Enable OLSRT support])

if test "$PHP_OLSRT" != "no"; then
PHP_NEW_EXTENSION(olsrt, php_olsrt.c, $ext_shared)
PHP_ADD_INCLUDE(/absolute/path/to/OLSRT/includes)
fi









⚙️ config.w32 (Windows)





ARG_ENABLE("olsrt", "Enable OLSRT support", "no");

if (PHP_OLSRT != "no") {
var OLSRT_INC = "C:\\path\\to\\OLSRT\\includes";
ADD_SOURCES(configure_module_dirname, "php_olsrt.c", "olsrt");
ADD_INCLUDE(OLSRT_INC);
}









▶️ Build & Install





Linux/macOS





phpize
./configure --enable-olsrt
make
sudo make install





Add to php.ini:




extension=olsrt.so









Windows




  • Run buildconf.bat

  • configure.js --enable-olsrt

  • Build with MSVC → output php_olsrt.dll

  • Copy to ext\ and add to php.ini:




  extension=php_olsrt.dll












🧪 test.php






<?php
if (!extension_loaded('olsrt')) {
@dl('olsrt.' . (PHP_SHLIB_SUFFIX ?? 'so'));
}

olsrt_hello();
echo "Version: ", olsrt_version(), PHP_EOL;






Run:




php test.php












🎯 Conclusion



And that’s it! You’ve just built a PHP extension that binds to OLSRT. Right now it’s a skeleton with olsrt_hello and olsrt_version, but the structure is ready for you to plug in Futures, Actors, Event Loop, Streams, and WebSockets from OLSRT.



This is the foundation—next steps could be:




  • Wrapping OLSRT Futures into PHP classes

  • Adding async/await‑like APIs

  • Building a real demo (e.g. chat server)









👋 Final words



Thanks for following along! I hope this guide helps you bring the async/event‑driven magic of OLSRT into PHP.


If you try this out, let me know what you build—I’d love to see it.



Until next time, have a great OLSRT day! 🚀

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How can I bind OLSRT to PHP?

Thematisch verwandte Begriffe: bind, OLSRT · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94097 | A vulnerability was determined in Netcore NBR200V2 1.3.241127.071246. Th…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick