We’ve multiple virtual hosts / domains setup in our server. I need to POST data to a file (basically execute the php and get the results) in a VHost from a different VHost (read: same server, different v-hosts).
I am able to do this with curl. Like curl http://vhost/file.php. But I am wondering if there is a better way to do this without curl, to execute a local php file. Another issue is with vhosts. vhosts are not configured properly. So localhost instead of vhost is the only choice, so it doesn’t work.
Any ideas?
Why do you need a “better” way? It works, and nothing actually goes out over the network, the traffic will bounce back up the network stack long before it hits the NIC. Unless you want to re-code these applications to deal with some strange new method of local invocation, I’d just leave it as it is.
The only thing that will actually go out over the network is a DNS request to resolve the hostname.