By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,929 Members | 634 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,929 IT Pros & Developers. It's quick & easy.

Help with a socket script execution

P: n/a
I have a chat application based on PHP and Flash, I know that is
necessary execute the socket server script from the console (#!/usr/
local/bin/php -q), but my problem is that I don't have SSH access to
the server where I have to deploy the application (a godaddy server).
Locally I could run the script even in my browser and the chat works
fine, but if I run the script in the server from the browser I
couldn't connect to it. Is there a way to run my socket script without
having SSH access to the server?

Jul 4 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
st**********@gmail.com wrote:
I have a chat application based on PHP and Flash, I know that is
necessary execute the socket server script from the console (#!/usr/
local/bin/php -q), but my problem is that I don't have SSH access to
the server [...]
Meet your new friend, php.net/exec .

And, if you're out of luck (i.e. the server runs with safe_mode on), you can
always rely on the (very) dirty trick of using a "Connection: close" HTTP
request, along with some PHP magic so the script doesn't die when the HTTP
connection is actually closed. I suggest you to do some research about
that.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
MSN:i_*************************@hotmail.com
Jabber:iv*********@jabber.org ; iv*********@kdetalk.net
Jul 4 '07 #2

P: n/a
On 3 jul, 21:14, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.orgwrote:
steven.ro...@gmail.com wrote:
I have a chat application based on PHP and Flash, I know that is
necessary execute the socket server script from the console (#!/usr/
local/bin/php -q), but my problem is that I don't have SSH access to
the server [...]

Meet your new friend, php.net/exec .

And, if you're out of luck (i.e. the server runs with safe_mode on), you can
always rely on the (very) dirty trick of using a "Connection: close" HTTP
request, along with some PHP magic so the script doesn't die when the HTTP
connection is actually closed. I suggest you to do some research about
that.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/;http:....upm.es/~ivan/
MSN:i_eat_s_p_a_m_for_breakf...@hotmail.com
Jabber:ivansanc...@jabber.org ; ivansanc...@kdetalk.net
I have luck!! my server is not compiled with safe_mode off... could
you give me a few details about how to use exec command? This command
only execute something and finish it execution or wait until the
command finish? I try with the following doesn't work:
<?php
$command = $APP_PATH . "/controllers/chat.php";
exec($command);
echo("done...");
?>

when I execute the script, the browser never finished the script I
couldn't see "done..."

Jul 4 '07 #3

P: n/a
st**********@gmail.com wrote:
On 3 jul, 21:14, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.orgwrote:
> steven.ro...@gmail.com wrote:
>>I have a chat application based on PHP and Flash, I know that is
necessary execute the socket server script from the console (#!/usr/
local/bin/php -q), but my problem is that I don't have SSH access to
the server [...]
Meet your new friend, php.net/exec .

And, if you're out of luck (i.e. the server runs with safe_mode on), you can
always rely on the (very) dirty trick of using a "Connection: close" HTTP
request, along with some PHP magic so the script doesn't die when the HTTP
connection is actually closed. I suggest you to do some research about
that.

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

http://acm.asoc.fi.upm.es/~mr/;http:....upm.es/~ivan/
MSN:i_eat_s_p_a_m_for_breakf...@hotmail.com
Jabber:ivansanc...@jabber.org ; ivansanc...@kdetalk.net

I have luck!! my server is not compiled with safe_mode off... could
you give me a few details about how to use exec command? This command
only execute something and finish it execution or wait until the
command finish? I try with the following doesn't work:
<?php
$command = $APP_PATH . "/controllers/chat.php";
exec($command);
echo("done...");
?>

when I execute the script, the browser never finished the script I
couldn't see "done..."
That means your chat.php script didn't complete before you PHP timeout
value.

Is this script supposed to be running all the time?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.