?
Solved

call C++ code from PHP

Posted on 2007-11-20
4
Medium Priority
?
2,023 Views
Last Modified: 2008-02-01
Hi,

Is it possible to call functions from a c++ file from PHP? Something like:

<?php
     CallSomeCPPFunction(); // somehow precompiled and usable by PHP directly
?>

No idea how the two could communicate, just wondering if it's possible.

Thanks
0
Comment
Question by:DJ_AM_Juicebox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 21

Expert Comment

by:nizsmo
ID: 20325958
Yes you should be able to call this to some extent, using the exec() function of PHP:
http://au3.php.net/function.exec

also alternatively you can use system():
http://au2.php.net/system

basically this executes any command like a commandline does.

Hope this helps.
0
 
LVL 15

Accepted Solution

by:
babuno5 earned 2000 total points
ID: 20325982
you could write a zend extension for your C++ function

Here some help related to it
http://devzone.zend.com/node/view/id/1021
0
 
LVL 9

Expert Comment

by:blue_hunter
ID: 20326222
make it your C++ function a CLI, and call it using system(), exec() to execute the function
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 20326239
it may be possible to call and execute in command mode of php server...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question