I'm attempting to call a PHP script from a C++ program. For instance, here is an example C++ program:
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
cout << std::system("test.php");
return 0;
}
This program is calling some script "test.php" which might be structured like this:
<?php
echo "Hello";
?>
When running the C++ code, I get the following:
sh: 1: test.php: not found.
Now the obvious thing to check is if the files are in the same directory (they indeed are), however the error still persists. Any feedback on how I might go about doing something like this?
Thanks.