need help....

7 views
Skip to first unread message

ankur krishna

unread,
Jan 4, 2012, 8:54:33 AM1/4/12
to FOSS@ITBHU
in a application i need to interact php with c++ as a backend
purpose..in d process c++ call from php can be done via command line
by executing exec() and passing suitable arguments but the other part
seems to be confusing..and also drawback in the c++ call from a php
function is that it leads via a call to .exe file and passing a
limited number of arguments means for every purpose i need to create
a .exe separately ..
basically my idea is to develop a omegal type web client for a random
chat functionality,so i am thinking c++ best to have proper linked
list and stacks algorithm....
how can i proceed??

Vidit Sinha

unread,
Jan 4, 2012, 9:33:17 AM1/4/12
to foss-...@googlegroups.com
Hi Ankur

Why C++ in the backend? Its still not clear to me. You can implement stacks, linked lists, algos in any programming language. If its just STL you wanna go for, there will be umpteen number of implementations and libraries. Lets say for collections you can google and easily find http://aheimlich.dreamhosters.com/generic-collections/Collection.phps 

Well there can be better platform/framework that you can use to create something like omeagle. For instance, J2EE app is one option.

What I want to say is that just don't try yourself from learning a new language, just because you know one. Alternatively, choose the best language/platform that suits your purpose.

Thanks & Regards,
Vidit


--
You received this message because you are subscribed to the Google Groups "FOSS@ITBHU" group.
To post to this group, send email to foss-...@googlegroups.com.
To unsubscribe from this group, send email to foss-itbhu+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/foss-itbhu?hl=en.


ankur krishna gautam

unread,
Jan 4, 2012, 10:48:44 AM1/4/12
to foss-...@googlegroups.com
thanks for d reply...
to use c++ in the backend ,i was inspired by d facebook
team,basically even algos are language independent rather to
implement data structure in a scripting language like php is a new
task.....


--
a.k.gautam

Gaurav Kumar

unread,
Jan 4, 2012, 12:38:36 PM1/4/12
to foss-...@googlegroups.com
Have a look at this:

Regards,
Gaurav

Harshath JR

unread,
Jan 4, 2012, 1:11:30 PM1/4/12
to foss-...@googlegroups.com
Some notes:

1. C++ is not best because it has "proper linked lists and all". If you want to use proper data structures and find them lacking in PHP, dont use PHP. Use Java. Use Ruby. Use Python. But most of all, I'd suggest use PHP the way PHP is meant to be used. Use the link Vidit emailed.

2. exec() is not the right way to call C++ from PHP. Look at writing php modules in c++. It is not the most trivial of things. Tutorial: http://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/

3. Thrift is an alternative to JSON in ajax (in its simplest form). Its a fast data serialization and de-serialization library, with interface definition and code generation tools to help you use the framework for cross platform development with ease (cross platform = not just limited to web apps/ajax).


Harshath
+91-767675-4811
Reply all
Reply to author
Forward
0 new messages