Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3348822
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:35:21+00:00 2026-05-18T01:35:21+00:00

I have finally created a very simple Hello World style PHP Extension dll on

  • 0

I have finally created a very simple “Hello World” style PHP Extension dll on windows, after immeasurable hassle. However, although I have successfully created a DLL, and put it in the extensions folder, and told php.ini about it, now I get this:

PHP Warning: PHP Startup: \x81\xc2\xc0\x03L&\xc0\x03: Unable to initialize module\nModule compiled with module API=16777522\nPHP compiled with module API=20090626\nThese options need to match\n in Unknown on line 0

Warning: PHP Startup: ÂÀL&À: Unable to initialize module
Module compiled with module API=16777522
PHP compiled with module API=20090626
These options need to match
in Unknown on line 0

It seems that my PHP_API_VERSION is 20090626, but for some reason my DLL thinks it’s PHP_API_VERSION is 16777522.

The tutorial below was some help in compiling an extension dll:
http://www.talkphp.com/vbarticles.php?do=article&articleid=49&title=creating-custom-php-extensions

Having written it myself, I have access to all of the source code for the php extension in question – But, where is it that I control the PHP_API_VERSION that ends up in the DLL?

I am compiling the dll successfully with Borland C++ Builder v5.5, not Visual Studio.

Here is the complete source, in case it matters:

// Needed to make following two #includes compatible with borland header files
void __fastcall __assume(int t) {
  return;
}
typedef unsigned int socklen_t;
typedef enum BOOL
{
  false=0,
  true
} bool;
// end Borland compatibility code

#include "php.h"
#include "zend_config.w32.h"
ZEND_FUNCTION(fetch_LinkGrammar_links);

zend_function_entry LinkGrammar_ext_functions[] = {
    ZEND_FE(fetch_LinkGrammar_links, NULL)
    {NULL, NULL, NULL}
};

zend_module_entry LinkGrammar_ext_module_entry = {
    STANDARD_MODULE_HEADER,
    "LinkGrammar Extension",
    LinkGrammar_ext_functions,
    NULL, NULL, NULL, NULL, NULL,
    "1.0",
    STANDARD_MODULE_PROPERTIES
};

ZEND_GET_MODULE(LinkGrammar_ext);

ZEND_FUNCTION(fetch_LinkGrammar_links)
{
    bool World = false;
    char *RetVal= "";
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &World) == FAILURE)
    {
        RETURN_STRING("Missing Parameter", true);
    }
    if (World == true)
    {
        RetVal= "Hello World";
    }
    else
    {
        RetVal= "Hello";
    }

    RETURN_STRING(RetVal, true);
}

What can I change to eliminate the PHP Startup Error that the API must match?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:35:22+00:00Added an answer on May 18, 2026 at 1:35 am

    It turns out it was the “Data Alignment” – My DLL was being compiled using “Word” alignment and it needed to be double-word.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple ASP.NET web application created under Visual Studio 2008 (SP1),
I'm trying to do something which should be very simple...I have a site with
I have created a simple application where I fetch questions from an Access database
I have a problem with this very simple block of code. please give me
I think I am thinking about routing all wrong. I have a very simple,
So I have access to a dedicated server and want to finally create my
I have a JSP custom Tag <ex:UndorderdList list=<%= MenuItems%>></ex:UndorderdList> which finally creates unordered list
I have finally made a production worthy app with play, and use the play
I have finally decided to go with the Entity Framework since it has the
I have finally worked out how to get stdin and stdout to pipe between

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.