views:

102

answers:

4

Hi,

In our cakephp application, we do a

file_get_contents('http://my.web.com',... );

Recently we changed the ip address of my.web.com, and we modified our /etc/hosts file, and flush dns cache using /etc/init.d/nscd restart, and restarted apache.

However, file_get_contents still refer to the old ip address, while if we do ping, nslookup, curl on my.web.com, we get the new ip address.

What are we missing?

Thanks

A: 

Have you try to restart the apache service?

Donny Kurnia
yes we restarted apache.
portoalet
A: 

Have you cleared out the cache files in app/tmp/cache? I think CakePHP caches external requests and if your app has a debug level of 0 then this cache will stick around for a while. Try deleting the files (not folders) or set debug to above 0 temporarily to force cache reload.

Benjamin Pearson
Assuming the OP is accurate in his description of the problem, then this is not something Cake will cache. `file_get_contents` is a pure PHP function that Cake doesn't have anything to do with.
deceze
+1  A: 

Just to be sure did you search your source code for occurrences of the old IP?

Leo
A: 

It turned out the address is also used as Apache's VirtualHost name in our old server. Removing this entry solved the problem. Thanks anyway guys :)

portoalet