php-extension

Convert Zval to char*

Hi all, I want to convert Zval to char*. how do i do that in my php extension? ...

Accessing Session variables in /ext/mysql extension

Hi all, I have declared a structure that look like typedef struct { char* key; char* value; }kvPair; and in the session structure, i declared a variable as struct session { char* id; ..... // other session variables kvPair* pair; } Now in the session_start I have initialised the values for the ...

Is it possible to invoke PHP_FUNCTION from within the extension

Hi all, let me elaborate more on the Title. Consider for example PHP_FUNCTION(session_start). Will I be able to invoke session_start from within session_id which is another PHP_FUNCTION (this is just for illustration not the actual purpose)? ...

create a php extension

Hey all, I have a PHP class I want to convert to a PHP extension. I checked some tutorials and it's a bit complicated (see here, here and here). It's just a hard work. I found this – a simple example with few andn small files. So wanted to ask if it is possible to use this to make it grab a PHP class from a certain path (say /home/web...

Compiling a php extension with Visual Studio 2008, MODULE ID don't match with php

After compiling my own php extension using VC9 (2008) and VC10 (2010) using the next steps: http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/ I get the next error when initializing php: PHP Warning: PHP Startup: FirstPHPExt Module: Unable to initialize module Module compiled with build ID=API20090626,TS...

Start compiling PHP extensions

I have code that is straight forward, but intensive. I would like to compile it into a PHP extension. What is the simplest / best practice for going about that? I have a Java background, so writing the C / C++ code shouldn't be an issue. I would, however, like to avoid any pitfalls along the way. A simple tutorial or walk through is s...

Zend Global Variable in an Extension Persisting Across Multiple Requests

Hi all, As the title explains, I want to maintain an information across requests from multiple clients. Let me put in a simple example to explain what I want. This example is just for illustration of my question and not the purpose of the post. Example: I want to count the total number of requests that a server has had so far fr...

Has anyone compiled a rabbitmq/amqp library for php 5.2.x on windows x64

I'm trying to publish messages to RabbitMQ from a php (5.2.x) script on my windows X64 dev machine. The problem is that I didn't find any dll extension for php. My collegue is actually trying to build it (cf. How do you compile a PHP extension on windows with cygwin/mingw?), but without success :(. Does anyone know where I can find a v...

PHP extension for Linux: reality check needed!

Okay, I've written my first functional PHP extension. It worked but it was a proof-of-concept only. Now I'm writing another one which actually does what the boss wants. What I'd like to know, from all you PHP-heads out there, is whether this code makes sense. Have I got a good grasp of things like emalloc and the like, or is there stuff...

7z extension for php?

I can't find one and I don't know if any of PHP Compression and Archive Extensions will work. Do you think I could use a compression stream to read data from a 7z file? UPDATE 7z forums have a lot of requests for a php extension ...

modifying php-imap extension to allow oauth authentication

My php application logs into to Gmail via oauth provided access keys and fetch headers for all messages in inbox. The php-imap extension allows only for login/password based authentication. I want to modify the extension so that it support oauth based authentication too. I need to figure out how to make that change inside the extension c...

Segmentation fault in my php extension

I wrote a php extension but couldn't find the reason why it reported segmentation fault. related code: char *tkey = (char *)emalloc(sizeof(char)*(result_pair[num-1].length+1)); std::memcpy(tkey, (text+i),result_pair[num-1].length); tkey[result_pair[num-1].length]='\0'; if ...