![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 4
![]() |
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. ** |
|
|
|
|
|
#2 |
|
Professional Programmer
|
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;} |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 4
![]() |
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...) |
|
|
|
|
|
#4 |
|
Professional Programmer
|
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;} |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|