sockobj.connect Errno 13 Permission denied

Discussion in 'Python' started by nobody, Jan 26, 2013.

  1. nobody

    nobody Guest

    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.
     
    nobody, Jan 26, 2013
    #1
    1. Advertising

  2. 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
     
    Joel Goldstick, Jan 26, 2013
    #2
    1. Advertising

  3. 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
     
    Joel Goldstick, Jan 26, 2013
    #3
  4. 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.
     
    Albert Hopkins, Jan 26, 2013
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alec Wysoker
    Replies:
    11
    Views:
    15,663
    Alec Wysoker
    Jan 12, 2006
  2. Joram Agten
    Replies:
    0
    Views:
    840
    Joram Agten
    Feb 1, 2006
  3. Replies:
    0
    Views:
    1,083
  4. viza

    &errno, sizeof errno

    viza, Sep 12, 2008, in forum: C Programming
    Replies:
    20
    Views:
    1,080
    Tim Rentsch
    Sep 14, 2008
  5. Clement Ow
    Replies:
    4
    Views:
    567
    Nick Romney
    Jul 6, 2009
Loading...

Share This Page