I am trying to call a PHP script from a C ++ program. For example, here is an example C ++ program:
#include <iostream> #include <cstdlib> using namespace std; int main() { cout << std::system("test.php"); return 0; }
This program calls some script "test.php", which can be structured as follows:
<?php echo "Hello"; ?>
When running C ++ code, I get the following:
sh: 1: test.php: not found.
Now itโs obvious to check if the files are in the same directory (they really are), however the error still persists. Any feedback on how I can do something like this?
Thanks.
source share