LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-28-2009, 09:07 PM   #1
demia
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Rep: Reputation: 15
Same user is fine on shell, not fine from Apache, weird..


Hi guys,

I have this strangeness,

I'm using this command to mount an ftp drive:$ curlftpfs Anonymous:@debian.org /mnt/path

now, if i run this command from shell as www-data user (i gave it temp login privileges to test this -debian,lenny,apache2)

it mounts that drive; but if i do exec('curlftpfs Anonymous:@debian.org /mnt/path'); it doesn't do anything.


exec settings are fine, safe mode is not on, permissions are fine, if i do exec('whoami',$c);print_r($c); it says that i am www-data.


What might be causing this? I'm lost


Thanks..
 
Old 04-29-2009, 02:41 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
From the 'print_r()' i surmise this is PHP, although you should have said.
Anyway, if you read http://au2.php.net/manual/en/function.exec.php, you'll see that exec() is a fn that returns a value... more importantly, it effectively creates a sub-shell/env for the cmd to run in. however, when it completes, anything in the 'sub' env disappears, inc the mount...
 
Old 04-29-2009, 10:22 AM   #3
suhas!
Member
 
Registered: Mar 2007
Posts: 100

Rep: Reputation: 17
I had faced this problem quite often. (not with curlftpfs command though).

Try to find out the location of your curlftpfs binary. I suppose its /usr/bin/curlftpfs, you just check it on your machine.

And then use in the code as below--

exec('/usr/bin/curlftpfs Anonymous:@debian.org /mnt/path');


I have came across such issue many times, I hope it resolves your issue.

Regards.
 
Old 04-29-2009, 11:05 AM   #4
demia
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 15
thanks suhas it worked like you said.
 
Old 04-30-2009, 01:09 AM   #5
suhas!
Member
 
Registered: Mar 2007
Posts: 100

Rep: Reputation: 17
cool!! it was the first time when my suggestion worked for someone!!

cheers!!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Why Microsoft's New EU Fine is Just Fine LXer Syndicated Linux News 0 02-28-2008 04:50 PM
Weird: Mandrake 10 will not make outbound connections, rest is fine icarus24 Linux - Networking 0 11-21-2006 04:54 PM
was working fine... but weird problems with wireless mrchaos Linux - Wireless Networking 5 06-03-2006 12:21 PM
audacity. can record once fine, but then the sound goes weird jimjamjahaa Linux - Software 2 01-20-2006 06:06 AM
smbclient fine, smbmount NOT fine hyllplan Linux - Software 4 07-01-2005 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration