Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37718 > unrolled thread

sockobj.connect Errno 13 Permission denied

Started bynobody <jupiter.hce@gmail.com>
First post2013-01-26 03:19 -0800
Last post2013-01-26 12:07 -0500
Articles 4 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  sockobj.connect Errno 13 Permission denied nobody <jupiter.hce@gmail.com> - 2013-01-26 03:19 -0800
    Re: sockobj.connect Errno 13 Permission denied Joel Goldstick <joel.goldstick@gmail.com> - 2013-01-26 08:47 -0500
    Re: sockobj.connect Errno 13 Permission denied Joel Goldstick <joel.goldstick@gmail.com> - 2013-01-26 08:52 -0500
    Re: sockobj.connect Errno 13 Permission denied Albert Hopkins <marduk@letterboxes.org> - 2013-01-26 12:07 -0500

#37718 — sockobj.connect Errno 13 Permission denied

Fromnobody <jupiter.hce@gmail.com>
Date2013-01-26 03:19 -0800
Subjectsockobj.connect Errno 13 Permission denied
Message-ID<c2c13a57-6f5e-46d0-b7f9-daaf6242c39a@googlegroups.com>
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.


[toc] | [next] | [standalone]


#37721

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-01-26 08:47 -0500
Message-ID<mailman.1076.1359208049.2939.python-list@python.org>
In reply to#37718

[Multipart message — attachments visible in raw view] — view raw

On Sat, Jan 26, 2013 at 6:19 AM, nobody <jupiter.hce@gmail.com> wrote:

> 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.



> 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.
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [next] | [standalone]


#37722

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2013-01-26 08:52 -0500
Message-ID<mailman.1077.1359208359.2939.python-list@python.org>
In reply to#37718

[Multipart message — attachments visible in raw view] — view raw

On Sat, Jan 26, 2013 at 8:47 AM, Joel Goldstick <joel.goldstick@gmail.com>wrote:

>
>
>
> On Sat, Jan 26, 2013 at 6:19 AM, nobody <jupiter.hce@gmail.com> wrote:
>
>> 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.
>
>
>
>> 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.
>>
>>
>>
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

>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
>
>
>
> --
> Joel Goldstick
> http://joelgoldstick.com
>



-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [next] | [standalone]


#37727

FromAlbert Hopkins <marduk@letterboxes.org>
Date2013-01-26 12:07 -0500
Message-ID<mailman.1085.1359220045.2939.python-list@python.org>
In reply to#37718

On Sat, Jan 26, 2013, at 08:52 AM, Joel Goldstick wrote:
> On Sat, Jan 26, 2013 at 8:47 AM, Joel Goldstick
> <joel.goldstick@gmail.com>wrote:
> 
> >
> >
> >
> > On Sat, Jan 26, 2013 at 6:19 AM, nobody <jupiter.hce@gmail.com> wrote:
> >
> >> 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.
> >
> >
> >
> >> 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.
> >>
> >>
> >>
> 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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web