Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > sockobj.connect Errno 13 Permission denied

Reply
Thread Tools

sockobj.connect Errno 13 Permission denied

 
 
nobody
Guest
Posts: n/a
 
      01-26-2013
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.



 
Reply With Quote
 
 
 
 
Joel Goldstick
Guest
Posts: n/a
 
      01-26-2013
On Sat, Jan 26, 2013 at 6:19 AM, nobody <> 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

 
Reply With Quote
 
 
 
 
Joel Goldstick
Guest
Posts: n/a
 
      01-26-2013
On Sat, Jan 26, 2013 at 8:47 AM, Joel Goldstick <>wrote:

>
>
>
> On Sat, Jan 26, 2013 at 6:19 AM, nobody <> 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

 
Reply With Quote
 
Albert Hopkins
Guest
Posts: n/a
 
      01-26-2013


On Sat, Jan 26, 2013, at 08:52 AM, Joel Goldstick wrote:
> On Sat, Jan 26, 2013 at 8:47 AM, Joel Goldstick
> <>wrote:
>
> >
> >
> >
> > On Sat, Jan 26, 2013 at 6:19 AM, nobody <> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission denied - (Errno::EACCES)- Help! Clement Ow Ruby 4 07-06-2009 03:45 PM
&errno, sizeof errno viza C Programming 20 09-14-2008 09:53 PM
Problem--IOError: [Errno 13] Permission denied patrick.waldo@gmail.com Python 0 10-28-2007 09:25 PM
os.remove OSError: [Errno 13] Permission denied Joram Agten Python 0 02-01-2006 05:41 PM
Occasional OSError: [Errno 13] Permission denied on Windows Alec Wysoker Python 11 01-12-2006 06:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57