Page 1 of 1
Embedding PHP into an application in C/C++
Posted: Fri Jul 18, 2003 5:07 pm
by TiGr0u
Hi
I would like to integrate the PHP interpreter in order to be able to script my application with php script. Is it possible ? Where can I find doc ?
Thanks
--
Damien
Posted: Fri Jul 18, 2003 11:55 pm
by Stoker
first you should read the Zend engine license (It differs a lot from the PHP license), there are some very strict wordings in there, not sure if it involves usages but it certainly involves all sorts of changes and integration.. But if the license is usable you can certainly use the engine API directly, although many have complained there is a great lack of documentation and code-comments for this.. (Zend/PHP isnt as open and free as many believe)
Posted: Sat Jul 19, 2003 5:01 am
by TiGr0u
thanks a lot for your answer.
It seems to be the reason why I don't find any things on that topic.
--
Damien
Re: Embedding PHP into an application in C/C++
Posted: Fri Nov 28, 2008 8:36 pm
by burek
i would also like to use php as a scripting language for my application (written in c++), because of the popularity of php and its easyness to learn..
are there any links that can help me to do this with php (i dont want perl/python/lua.. i want php)
thanks in advance for any help on this..
Re: Embedding PHP into an application in C/C++
Posted: Fri Nov 28, 2008 8:40 pm
by josh
Uhh you could have your APP just use the PHP CLI and implement a basic framework in PHP, letting framework implementers create a subclass with overridden template methods specific to your domain
Re: Embedding PHP into an application in C/C++
Posted: Sat Nov 29, 2008 6:35 am
by Kieran Huggins
Do you mean bindings?
http://objectmix.com/ruby/346743-help-u ... dings.html
Somehow I doubt PHP is the ideal language for this... you should really reconsider a more flexible language like Ruby or LUA. PHP is mostly just a collection of compiled functions with a (very) good manual.
Re: Embedding PHP into an application in C/C++
Posted: Sat Nov 29, 2008 7:19 am
by Mordred
+1 for Lua.
Re: Embedding PHP into an application in C/C++
Posted: Sat Nov 29, 2008 11:40 am
by burek
I know how to do it with Lua, but I need to do it with PHP.. Is this possible?
Re: Embedding PHP into an application in C/C++
Posted: Sat Dec 06, 2008 8:18 pm
by Chris Corbyn
Bundle PHP with the app. You can compile PHP as a command line executable just like perl or python. Then you can just make exec or system calls to the binary.
Re: Embedding PHP into an application in C/C++
Posted: Mon Dec 22, 2008 11:57 pm
by Weirdan
There's only one good source of information on this subject I'm aware of (except reading the source code, of course

) - the book
Extending and embedding PHP. Your will have to buy it though - Google's copy skips some pages.
Re: Embedding PHP into an application in C/C++
Posted: Tue Dec 23, 2008 1:47 am
by josh
This book is golden, thanks. $2 used in amazon marketplace - I had to directly bypass my wishlist queue

Re: Embedding PHP into an application in C/C++
Posted: Tue Dec 23, 2008 6:20 am
by burek
Thank you for your help, I've found a book on some dc hub (63KUZCCV4FJHCW3YIIHIEPK5MABL55Z76HWG5NQ) and it is really helpfull, so I'll take a look into it.
Once again, thanks a lot for the help.
Re: Embedding PHP into an application in C/C++
Posted: Thu Jan 01, 2009 10:38 am
by SteelSlasher
Just adding a suggestion here-
You could use WinBinder which lets you use the win32 api within your php app so in theory you could use this. It can also be intergrated with c++ by using dlls
You could also use php-gtk but i havent used that before so i cant recommend it but only suggest it
Re: Embedding PHP into an application in C/C++
Posted: Sat Jan 10, 2009 11:06 am
by jason.carter
Also, a good idea to try the VxWorks and also the GoAhead web server. Embedded webserver and it supports PHP.