473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Why call to php extension function in c++ is showing undefine?

I tried to create php extension using VS2010, wamp server and php. Project I created following the step given at : http://www.dreamincode.net/forums/to...n-for-windows/

was successful and projectname.dll file created.
I am using: Apache/2.2.22 (Win32) PHP/5.4.3

I copied this dll file into path: C:\Wamp\bin\php\php5.3.5\ext and added extension=php7.dll into php.ini file also.

I can see php7.dll is there in active php extension list.

but when I run php file with phpinfo() then I found that extension was not successful. I used following code in .cpp file to create the extension:

Expand|Select|Wrap|Line Numbers
  1. #define PHP_COMPILER_ID  "VC6"
  2.  
  3. #include "php.h"
  4.  
  5.  
  6. ZEND_FUNCTION(use_html);
  7.  
  8. zend_function_entry use_functions[] = 
  9. {
  10.     ZEND_FE(use_html, NULL)
  11.     {NULL, NULL, NULL}
  12. };
  13.  
  14. zend_module_entry use_html_module_entry = 
  15. {
  16.     STANDARD_MODULE_HEADER,
  17.     "Use Html",
  18.     use_functions,
  19.     NULL, NULL, NULL, NULL, NULL,
  20.     "1.0.0-tutorial",
  21.     STANDARD_MODULE_PROPERTIES
  22. };
  23.  
  24. ZEND_GET_MODULE(use_html);
  25.  
  26. ZEND_FUNCTION(use_html)
  27. {
  28.      bool useHtml;
  29.  
  30.      if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &useHtml) == FAILURE)
  31.      {
  32.          E_ERROR;
  33.          return;
  34.      }
  35.  
  36.      if(useHtml)
  37.      {
  38.          php_printf("This string uses <a href='#'>Html</a>");
  39.      }
  40.      else
  41.      {
  42.          php_printf("This string does not Html");
  43.      }
  44.  
  45.      return;
  46. }
Now I could see "Use html" when I run phpinfo() function.

But it is not there! What can be the problem?
Jun 20 '13 #1
0 1035

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: rgristroph | last post by:
I have an extension in C++, which I compile as a module for php 4.3.11. I am using PHP 4.3.11 on Fedora Core 4, which has gcc 4 instead of gcc 3.2. Fedora Core 4 normally comes with PHP 5, but I...
0
by: Michael Schmitt | last post by:
Hello. I wanted to capture the stdout output of a called extension function. Michael Hudson kindly suggested a way to redirect filedescriptors. I still can't get this working: fd_stdout=...
0
by: Arjen Haayman | last post by:
Hello, I'm using Xalan and have written Java classes as extension functions. According the documentation the return value of an extension function can be a Result tree fragment: (==...
1
by: Fisch von Gestern | last post by:
I have tried to run the extension function/element examples provided with the Xalan-J download. I believe that my classpath is correct, and that my versions are up-to-date. However, I can't get...
0
by: Jay Allard | last post by:
Hello I posted this in the vb.net group on the 2/25/2004, but didn't get any response. Here's attempt 2. Does anyone know of a more appropriate place to post this? One new piece of...
3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
4
by: Mark | last post by:
Hi.. I have a c# class that i'm using to implement some extension functions and one of those functions is a simple push/pop stack. I made the c# code fairly generic, taking and returning objects...
2
by: Matthew Louden | last post by:
I want to provide date selection in a page. Basically I want to have similar effect as DTPicker in Visual Basic. My idea is to create a calendar control in mycalendar.aspx. Then I create a...
1
by: Neha Mandloi | last post by:
Hello Everyone, I am trying to pass a nodelist to a java method from xsl stylesheet. For ex. if I come across a situation where result is temporarily saved as a document fragment <xsl:variable...
4
by: harryajh | last post by:
Using xalan 2.7.1 I'm using XSLT extension functions to retrieve special bits of code from a java class static methoth during transformation. What I'd like to know is if there is anyway to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.