How can i talk from php to mql4 ???

 

Hello, i know how to talk from mql4 to php like "WebRequest" and having and php side api that handles requests.

 

but how can i talk from php side to the mql4 side ? thanks 

 
repxl:

Hello, i know how to talk from mql4 to php like "WebRequest" and having and php side api that handles requests.

 

but how can i talk from php side to the mql4 side ? thanks 

Is your computer with MT4 directly accessible from the place you are running the php (usually indicated by a unique IP address)?
 
Ovo Cz:
Is your computer with MT4 directly accessible from the place you are running the php (usually indicated by a unique IP address)?

Hello, well i'm using Virtual Box linux and host pc is windows so they psychically run on the same machine but in fact php runs on linux side and MT4 on windows.

anyway tell me what you had in mind i wanna know all the ways i can do it (i think you wanted to use command line ?) 

 
repxl:

Hello, well i'm using Virtual Box linux and host pc is windows so they psychically run on the same machine but in fact php runs on linux side and MT4 on windows.

anyway tell me what you had in mind i wanna know all the ways i can do it (i think you wanted to use command line ?) 

The idea behind was using http://php.net/manual/en/function.socket-connect.php, to connect to a listening MT4 script. Unfortunately, I have no experience with Windows under linux, whether they can reach each other by a socket.
PHP: socket_connect - Manual
  • php.net
The parameter is either an IPv4 address in dotted-quad notation (e.g. 127.0.0.1) if is , a valid IPv6 address (e.g. ::1) if IPv6 support is enabled and is or the pathname of a Unix domain socket, if the socket family...
 
repxl:

but how can i talk from php side to the mql4 side ? thanks 

What is your requirement exactly? As a server-side script, PHP is normally accepting and processing incoming requests from clients, but its usage as a client for sending outgoing requests is somewhat awkward (though feasible of course). Maybe you need to change your architecture or consider long-polling?

I'm not sure what Ovo Cz means by "a listening MT4 script", because real sockets (including listening sockets) are not supported in MT AFAIK. But you can use dlls for that purpose.

Reason: