1

I had two CI projects in my local machine named client & server. The client has a controller Welcome which has two functions __controller() & greet() with echo statements "hello from controller" and "hello from greet" respectively. The server has a controller named cron which has a function test() with the following piece of code:

$opts = array('http' =>
    array(
        'method' => 'GET',
        'timeout' => 10
    )
);
$context = stream_context_create($opts);
$url = "http://localhost:2016/Welcome/greet/";
echo $url . PHP_EOL;
var_dump(file_get_contents($url, TRUE, $context));

When I accessed the test controller through browser, it displayed Hello from controller. Hello from greet. as I had expected.

Later I moved both server & client projects to two different LAMP servers and accessed the same test controller through my browser but the result was only Hello from controller. Am I missing something here?

DhiwaTdG
  • 748
  • 1
  • 10
  • 26
  • please provide more information – riya Jul 25 '16 at 12:33
  • @riya Sorry I'm not sure what you are looking far but I've posted everything I did. – DhiwaTdG Jul 25 '16 at 12:36
  • create routes for ur controller action plz refer : http://stackoverflow.com/questions/28288239/codeigniter-how-do-i-setup-routing-for-controller-class-and-method or https://www.codeigniter.com/userguide3/general/routing.html – Jatinder Kaur Aug 10 '16 at 07:00

0 Answers0