Hi Yang Li:
I don't know anything about php, but I think I recognize the problem.
Typically, when you execute a unix command from a scripting language, it's
like doing it in a subshell; the command executes and the subshell exits.
So what you need to do is to figure out how to execute all of your
commands within the same subshell. If they were simple commands like cd
and pwd, you could just issue
$cmd =" cd /directory/path ; pwd"
(sorry if the syntax is wrong; I have no idea what it is supposed to be).
Maybe a better idea is to embed a "here document" in the script so you
have one shell for all the commands, or create a temporary file and echo
the commands into it, make it executable, and then run it.
I'm curious to know what you are trying to do...
Best of luck.
Bill
yang li wrote:
> Hi All,
> I have some scripts which need to use some programs--like cad,
> refmac--in ccp4, and I want to
> use a php script to run these scripts, with command as : $cmd =" sh
> aa.inp"; system($cmd);
> As I know, when I use php script, the account is Apache, which is a
> nologin account, all the files I used
> are put in the directory which belong to Apache.I donnot know what shell
> it
> uses, assume it uses bash,
> since Apache has no permission to /ccp4/include/ccp4.setup, I copied
> ccp4.setup to the directory I used.
> And add a line in the script to source this ccp4.setup, file, but it gives
> such error information:
> ********************* WARNING ********************** The directory
> /home/prog/ccp4 (assigned to CCP4_MASTER) does not exist. The CCP4
> programs
> will not run correctly, and any installation attempt will have errors or
> will fail. ********************* WARNING **********************
> I donnot know how to solve this problem. Anyone knows how to run the
> ccp4 programs with the php script?
>
> Thanks!
>
|