Page 1 of 1
How to integrate C in PHP
Posted: Mon Jan 05, 2004 2:06 am
by shaky
How to integrate C in PHP
dear friends,
I really really need help on how i can integrate c program in php. I need some example on how to do it. I've try to read the php manual on php.net but i can't understand it.
->My project- developing a web-based system (written in php) for a
consultancy company and implementing ECC algorithm (encryption) (written in C) to the company's critical data.
Please!!!
Thanks a lot in advance.
-shaky-
Posted: Mon Jan 05, 2004 3:43 am
by Weirdan
It depends on how your C program receive and output the data...
Program execution functions, Process control functions, pipes, shared memory... it's up to you to choose.
Posted: Mon Jan 05, 2004 4:20 am
by volka
or maybe even writing an extension. The php source code package provides a lot of examples of them.
Posted: Mon Jan 05, 2004 4:58 am
by shaky
hi volka!
*******************************************************
or maybe even writing an extension. The php source code package provides a lot of examples of them.
*******************************************************
how do i write an extension?
where do i find the php source code package?
thanks
Posted: Mon Jan 05, 2004 5:02 am
by Nay
Posted: Mon Jan 05, 2004 6:50 am
by volka
all extensions are in the directory ext/
start by analyzing a simple extension like tokenizer
http://www.php.net/manual/en/zend.php will help you understand esp. the macros.
There's also a script ext_skel (or ext_skel_win32.php) that helps you creating your own extension
Posted: Mon Jan 05, 2004 6:25 pm
by Sevengraff
Have you looked at the pear package
Inline_C?
Or if you want to run the compiled program in php, then you can probably use [php_man]shell_exec[/php_man]
Posted: Sat Jan 10, 2004 10:05 am
by shaky
Can anybody explain to me step by step what i have to do to integrate C in PHP 'coz i've try to read the php manual u guys suggested, especially
http://www.php.net/manual/en/zend.php. It is to complicated for me to understand especially now i'm running out of time.
Actually, my project is to develop a consultancy info system, where user have to enter their username and password to use the system (in php environment). So then i want to encrypt the password using an algorithm called ECC in C language. That is why i need to integrate C in PHP.
Do you think that's possible? i mean i want to sent the password which user entered to the C program to be encrypt and then send it back to the php program to compare it with the password in the database.
Please help me! I need to know what setting i have to do?
Can i just use Borland Turbo C++? I've try to run simple extension tokenzier using Turbo C++ as suggested by mr. volka, but there are so many error like "unable to open include file PHP.h"!
What can i do? Is there any setting that i need to do first?