Embedding PHP into an application in C/C++
Moderator: General Moderators
Embedding PHP into an application in C/C++
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
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
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)
Re: Embedding PHP into an application in C/C++
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..
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++
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
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: Embedding PHP into an application in C/C++
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.
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++
+1 for Lua.
Re: Embedding PHP into an application in C/C++
I know how to do it with Lua, but I need to do it with PHP.. Is this possible?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Embedding PHP into an application in C/C++
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++
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++
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++
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.
Once again, thanks a lot for the help.
-
SteelSlasher
- Forum Newbie
- Posts: 5
- Joined: Fri Sep 12, 2008 12:54 pm
Re: Embedding PHP into an application in C/C++
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
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
-
jason.carter
- Forum Commoner
- Posts: 35
- Joined: Sat Jan 10, 2009 10:05 am
Re: Embedding PHP into an application in C/C++
Also, a good idea to try the VxWorks and also the GoAhead web server. Embedded webserver and it supports PHP.