Print PHP-CPP results in browser

126 views Asked by At

I am developing a PHP-CPP extension with c++. My extension is working perfectly when i run it through the command line. But when i try to run it in browser then the browser shows the error that class or functions not declared there. Can anyone tell me how to run it in browser?

PHP file:

 <?php
   include 'main.cpp';
   ini_set('display_errors', 1);
   ini_set('display_startup_errors', 1);
   error_reporting(E_ALL);
   echo "Check string";
   $obj = new item();
   echo "string";
   $obj->DBconnect();
   echo "string";

 ?>

Please see the picture Picture will provide the better idea

1

There are 1 answers

3
coderwelsch On

It is possible that you have forget to edit the correct configuration file?

You wrote in CLI it isn't a problem. Maybe you have only append your extension in: /etc/php5/cli/php.ini

but maybe not in /etc/php5/apache2/php.ini