sockobj.connect Errno 13 Permission denied

N

nobody

Hi,

I have a client program Client.py which has a statement of sockobj.connect(), the port number 60000 is used, so no problem from port permission.

I am puzzled because I can run Client.py from command line in my user account or apache user account without any problems.

But if I run it from a web page http://localhost/client.php, the client.php called exec("Client.py"), then it got an exception of sockobj.connect Errno 13 Permission denied.

Why it can run from command line, but cannot make connection from a web file? Appreciate any tips and clues.

Thank you.

Kind regards.
 
J

Joel Goldstick

Hi,

I have a client program Client.py which has a statement of
sockobj.connect(), the port number 60000 is used, so no problem from port
permission.

I am puzzled because I can run Client.py from command line in my user
account or apache user account without any problems.

But if I run it from a web page http://localhost/client.php, the
client.php called exec("Client.py"),



Check the arguments to exec. I think it has to be an open file object.
 
J

Joel Goldstick

Check the arguments to exec. I think it has to be an open file object.
Maybe I spoke too soon. You should probably be asking in a php forum since
what you are doing is running a php exec. If you are actually getting a
python error you should show the code and the traceback so that someone can
look at your code.

In either case (py and php) it looks like exec needs either a string of
executable text or (in py case) an open file handle. So the code you
describe isn't really what you are running
 
A

Albert Hopkins

Maybe I spoke too soon. You should probably be asking in a php forum
since
what you are doing is running a php exec. If you are actually getting a
python error you should show the code and the traceback so that someone
can
look at your code.

In either case (py and php) it looks like exec needs either a string of
executable text or (in py case) an open file handle. So the code you
describe isn't really what you are running

Also your php/apache config needs to be set up to enable execs (I think
it's off by the default).

Either way it's a PHP question, not a Python question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top