Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 29th, 2005, 8:13 PM   #1
ktsirig
Programmer
 
Join Date: Oct 2005
Posts: 54
Rep Power: 4 ktsirig is on a distinguished road
External programs ---Grrrrrrrrrrr

Hi all!
I have just installed my first Linux distribution (SUSE 10.0).
Everything is compiled as far as Apache, Mysql & PHP is concerned.
But, I have this problem: I call system commands through PHP using system, shell_exec etc
The thing is that PHP responds OK when it comes to 'ls' or 'grep' or 'wget', but, in another program,
not UNIX-native, there is no response.
I am sure that the program is set up in the PATH, because, if I open a terminal, I can call it from everywhere and it works fine!
Any ideas on why PHP can't call it like 'ls' for example?

**One thing that really angries me is that in the University, these things work fine, and the external program is called without any problem. **
ktsirig is offline   Reply With Quote
Old Oct 29th, 2005, 10:46 PM   #2
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
What do you mean by "not UNIX-native", and what other program is this?
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old Oct 30th, 2005, 4:59 AM   #3
ktsirig
Programmer
 
Join Date: Oct 2005
Posts: 54
Rep Power: 4 ktsirig is on a distinguished road
Hi, thanx for your answer.
the program I want to call is a biological one (I am studying biology), that can be installed and ran locally on a UNIX machine.
I have installed it as root user and I have checked that it can also be ran in my home directory, without having to call it from the full path.
However, I tried calling it like /usr/local/bin/hmmpfam (hmmpfam is the name of the program), but again no luck.
What I can only think about has to do with Apache. I mean that, the documents I use are stored in /srv/www/htdocs.
I think that when you ran something in your webserver, this is executed as wwwrun user, right?
do you think I must somehow grant privileges to this user specifically ?
(I just want to note that the html or other files in the htdocs/ directory are functioning correctly. Only that problem with the external program is not executed...)
ktsirig is offline   Reply With Quote
Old Oct 30th, 2005, 8:51 AM   #4
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Apache will run files with whatever privileges it was originally run with. If the Apache Server binary is launched by a user called wwwrun and they don't have execute access to the binary, Apache won't be able to execute it.

What you can do is chmod the binary to 755 ( # chmod 755 /usr/local/bin/hmmpfam ). Also make sure that /usr/local/bin/hmmpfam is in your PATH, as my executables are stored in /usr/bin.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:12 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC