Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: problems with exec() Date: Wed, 18 Apr 2012 18:02:11 +0200 Lines: 23 Message-ID: <9v86s3FrkcU1@mid.individual.net> References: <9-SdnWmoCP7eZBfSnZ2dnUVZ7q6dnZ2d@giganews.com> <9v0fldFforU1@mid.individual.net> <9v0vlnF4m6U2@mid.uni-berlin.de> <9v100mF8g6U1@mid.uni-berlin.de> <9v1oc1FvdvU1@mid.individual.net> <4f8bd352$0$21937$426a34cc@news.free.fr> <9v338gFtdpU1@mid.individual.net> <4f8ec54d$0$16482$426a74cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net Pm9UrnL3RlA3/TSMME0/2gkNaFbIQgak+l2GSsok+8ToBl4Tvs Cancel-Lock: sha1:4+Sl6ZC9lR/ey2VoVvyvHtdIuOU= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120321 Firefox/11.0 SeaMonkey/2.8 In-Reply-To: <4f8ec54d$0$16482$426a74cc@news.free.fr> Xref: csiph.com comp.lang.php:5561 Une Bévue wrote: > Le 16/04/2012 19:29, J.O. Aho a écrit : >> I suspect it could have the same issue, try to use shell_exec and let us >> know if it works. > > Unfortunately, not. > i suspect because the line : > > $cmd = ssh -L 63333:localhost:5432 -f yt@iMac -N > > is without password for the user 'yt' not for php being of user 'www_data' on > Ubuntu. > > Nevertheless i got that pgsql db working remotly after editing pg_hba.conf. Otherwise, you can copy the public key to the www-data users ~/.ssh and the ssh would have worked. Of course you could have setup a cron job instead which would recreated the tunnel each time it went down. Of course those two solutions aren't as good as using the proper method. -- //Aho