php-extension

extend php with java/c++?

i only know php and i wonder if you can extend a php web application with c++ or java when needed? i dont want to convert my code with quercus, cause that is very error prone. is there another way to extend it? cause from what i have read python can extend it with c++ without converting the python code and use java with jython? ...

How to develop C extentions for PHP apps?

My PHP app has a number-crunching part that is just to slow for PHP, so I was thinking of building a custom C extention, but it is impossible to find any good reference to start with :( Is there a guide on how to do something like this? ...

PHP Extension using libtidy compiles, but does not load

I wrote an extension in C++ that uses libtidy, and it runs perfectly under PHP when I compile PHP --with-tidy. However, it would be nice to have the extension run on a vanilla PHP. When I try to use the extension, I get something like: PHP Warning: PHP Startup: Unable to load dynamic library 'extension.so': undefined ...

php 5.3.2 + MS SQL (can`t connect)

I allways used php 5.2.3 version ,but now I updated php to 5.3.2 version. I have problem with mssql,I can`t connect to mssql server. I have downloaded a sql server driver for php 1.1 There are a lot of files, i used 'php_sqlsrv_53_ts_vc9' Put it on php/ext directory 'php_sqlsrv_53_ts_vc9' I have added - extension=php_sqlsrv_53_ts_...

Call external library from PHP. What is faster: exec or extension?

Hi, I need to make calls from webpage to external library written in C++ and display the result. Platform is Linux, Apache, PHP. My current idea is to use PHP service which will call my library/program. I found that there are two possible ways to do this: 1) use PHP 'exec' function 2) write PHP extension I am curious what works more ...

How should I understand these PHP errors?

This is out of the error log: PHP Warning: PHP Startup: BOPEE Extension: Unable to initialize module Module compiled with build ID=API20090626,TS,VC9 PHP compiled with build ID=API20090626,NTS,VC9 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: CustomExt Module: Unable to initialize module Module compile...

stdout from SWIG-generated PHP extension

I have the following C++ function: void foo() { std::cout << "bar" << std::endl; } I'm porting this to PHP via SWIG. Everything compiles fine and the extension loads properly. I'm able to call foo() from PHP, but I only see the bar output if I run the PHP script from the command line. $ php script.php bar If I load the script i...

Wrapping boost::shared_ptr in PHP using SWIG

If I use SWIG to wrap this C++ function: boost::shared_ptr<Client> Client::create() { return boost::shared_ptr<Client>(new Client()); } And then call it in PHP: $client = Client::create(); echo gettype($client); The type of $client is resource, not object, and so I cannot call Client methods. What are my options for wrapping t...

Making C functions available to php

I have a C dll containing functions and enumerations I want to make accessible from php. How can I do it? ...

Build environments for PHP extensions?

Looking for development frameworks for creating custom PHP Extensions. PHP4Delphi looks promising. And there's the usual Visual Studio route. Are there any others? ...

Fetching zend resource without knowing type of the resource

It is possible to fetch the zend resources (zend_fetch_resource) without knowing the type of the fetching resource? If so, how? Note: I am writing PHP extension. ...

Memory leak from SWIG-generated extension

I'm having a memory leak problem wrapping a C++ library in PHP using SWIG. It seems to happen when callbacks from C++ containing complex types are sent to PHP while directors are enabled. Here is a standalone example to reproduce the leak: Client.hpp: #ifndef CLIENT_HPP_ #define CLIENT_HPP_ #include <vector> #include "ProcedureCallbac...

Where to find demo code of working PHP extension for VS2008 targetting PHP 5.3.x and Windows?

There seem to be so many half-documented ways of writing extensions for PHP in Windows. Can anyone point me to source code which demonstrates an extension compiled under VS2008 and working in a PHP 5.3.x environment? ...

PHP not loading custom extension

Hey all, I'm writing a custom extension in PHP and am loading the extension in the php.ini file. The extension loads and runs fine when using the command-line interface, but it doesn't load in the web server (Cherokee with FastCGI). To head off some questions before they're asked, I am definitely using the proper php.ini file(s) and I'v...

Anyone can provide uploadprogress.dll extension for php 5.3.0?

I need uploadprogress extension for php on windows. I downloaded dlls from here, but the version doesn't match with my php. I have php 5.3.0 build 20090626 VC++6. And I couldn't find a compatible uploadprogress.dll. I can't build it because I don't have php source of my version. Also I don't want to use APC extension. can anyone provide ...

PHP Extension : Module 'hello' already loaded in Unknown on line 0

Hi all. My development environment: Linux - Linux localhost.localdomain 2.6.9-42. apache:2.2.4 php:5.2.3 I wrote a php extension hello. when i make test it show me: PHP Warning: Module 'hello' already loaded in Unknown on line 0 PHP Warning: Module 'hello' already loaded in Unknown on line 0 I check the php.ini , there is just...

Resource garbage collected too early

I've created a PHP extension with SWIG and everything works fine, but I'm observing some strange garbage collection behavior when chaining method calls. For example, this works: $results = $response->results(); $row = $results->get(0)->iterator()->next(); printf('%s %s' . "\n", $row->getString(0), $row->getString(1)); But this seg fau...

Please please PLEASE someone have Tidy2.0 extension

So I'm trying to get Tidy2.0 installed on my Karmic, following this guide: http://www.howtoforge.com/forums/archive/index.php/t-7395.html I figured everything would work, but it seems the source for Tidy2.0 is no longer live: http://support.office-shadow.com/installer/tidy2.0.tar.gz That site is still live though (office-shadow.com, na...

Compiling PHP with modified DEBUG_ZEND level

I'm debugging a PHP extension and found this while poking through the PHP source code: #if DEBUG_ZEND>=2 printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, Z_REFCOUNT_PP(zval_ptr), Z_REFCOUNT_PP(zval_ptr) - 1); #endif So I want to compile with DEBUG_ZEND set to 2. In Zend/zend_compile.h, I saw: #define DEBUG_Z...

_COOKIE Info on the server Side

Hi all, I want to get the cookie information stored using setcookie function in the source code of the php.. not the php source code.. What is the corresponding C code for _COOKIE['xx']; In other words where is the _COOKIE array created and populated? ...