C++ app on linux via PHP

thickglass

New member
Registered
Joined
Nov 17, 2016
Messages
1
Points
0
Hi guys, is there a way to run a C++ app on linux via PHP? For example user passes post request to php script and php runs a C++ app...
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
You can execute an external program using PHP with the exec() function.

Example usage:

<?php

exec ("/home/user/file_to_execute");

?>

You could have problems with permissions depending if PHP is executing as the user or the webserver, i.e suPHP.

Hope this helps.
 

stackstar

Member
Registered
Joined
Nov 22, 2016
Messages
30
Points
0
Executing binary files via web such as PHP has security concern implications. Its generally not a best practice to execute binary (i.e. compiled C++ applications) via a web interface because the binary file usually doesn't have the same constraints as native PHP.

Usually most web hosts disable the exec() function anyways because of this.
 
Older Threads
Replies
14
Views
10,008
Replies
6
Views
3,837
Replies
4
Views
5,624
Replies
24
Views
8,747
Newer Threads
Replies
7
Views
3,154
Replies
6
Views
2,542
Replies
9
Views
5,231
Replies
12
Views
5,613
Latest Threads
Replies
0
Views
117
Replies
0
Views
65
Replies
0
Views
57
Replies
1
Views
87
Recommended Threads
Replies
10
Views
5,345
Replies
7
Views
3,463
Replies
6
Views
4,426
fwh
Replies
0
Views
2,292
Replies
6
Views
6,698
Similar Threads
Replies
0
Views
1,175
Replies
8
Views
1,456

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top