shell_exec() will not execute outside htdocs folder
Posted: 26. July 2010 07:41
I am trying to run Image Magick from shell_exec. I thought that would be more simple than trying to change the php version and compile Image Magick. Regardless of that, I seem to have a problem. Here it is.
That is expected. Here is the problem.
I have not found any result that works. I can:
I can't
Any ideas?
PHP is not in safe mode.
- Code: Select all
<?php
// shell_exec test
shell_exec('mkdir test');
//resulting output is found in
// C:/xampp/htdocs
//as the following:
// C:/xampp/htdocs/test
?>
That is expected. Here is the problem.
- Code: Select all
<?php
$cmd1 = 'cd C:/';
$cmd2 = 'mkdir test2';
// shell_exec test 1
shell_exec($cmd1 && $cmd2);
//shell_exec test 2
shell_exec($cmd1."".$cmd2);
//shell_exec test 3
shell_exec('cd C:/; mkdir test2');
//resulting output is found in
// C:/
//as the following:
// C:/test2
?>
I have not found any result that works. I can:
- Code: Select all
$output = shell_exec('dir');
echo $output;
I can't
- Code: Select all
$output = shell_exec('chdir C:/')
//output in apache error log says "The system cannot find the path specified."
Any ideas?
PHP is not in safe mode.