[PHP-DEV] Re: [PHP] how to call c/c++ (BIG PROBLEM) From: Thomas Angst (ta_php <email protected>)
Date: 12/01/00

----- Original Message -----
From: forestwater <forestwater <email protected>>
> Can php call c and c++ program?
> And how to call c and c++ program?

Well, yes you can. And I can tell you how you should do it.
But it's not running on my system. :(
If you find out how, please tell me.

The main page for that info you can find it at:

http://www.zend.com/apidoc/

for short:
go to your php source dir.
change to ./ext
and execute there ./ext_skel --extname=<yourmodulename>
after that you will have a folder in the ext dir with your suggested name.
And you will also have a C code skeleton for the interface of php.

testing it:
cd ..
./buildconf - this will create a new configure file
./configure - build your new Makefile
make - compile the whole thing

voila - that should be all ---- should
but in my case - it's not working :(
it didn't linked to the main program nor it has a .so file
you can change the configure file

  if test "" = "shared"; then
to this
  if test "shared" = "shared"; then
(And this is surly not the right way to toggle to a .so library)

to get a .so file but this will not be accepted by php.

--> Warning: Invalid library (maybe not a PHP library) 'first_module.so' in
/home/pub/granit/first_module.php on line 2

IF ANYBODY HAS AN IDEA ---> HELP!!!
I'm going crazy here, I don't know what I can do different.

Thomas

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>