PHP系统(“cd \”);(PHP system(“cd \”); not working)
我以前通过php文件使用系统命令.cd \工作然后在几次尝试之后突然停止:| 不管我做什么
<?php $command = array("cd \","dir"); $result = system($command[0], $return); ?>i used to use system commands through a php file ..cd \ was working then suddenly after a few tries it stopped :| no matter what i do
<?php $command = array("cd \","dir"); $result = system($command[0], $return); ?>最满意答案
Windows支持正斜杠/以及反斜杠\所以通过使用正斜杠,你应该交叉兼容,并且从长远来看不会恶化。
<?php $command = array("cd /","dir"); $result = system($command[0], $return); ?>Wiki Path_Computing
如果您有任何错误,请发布它们,因为问题可能不是目录削减,因为您说它以前工作。
I think i figured out the problem.. the system() command in PHP does not create an instance of a cmd.exe instead it only executes the command and exits. that is why when you change directory using CD command ..the directory of the instance created by system() is changed and then exits.i hope my theory is correct xD
更多推荐
发布评论