Hi,
We purchased a site replicator plugin, only to find out it doesn't work on windows and support told me to fix it myself.
I have replaced the following line..
with...
But the plugin just hangs. I beleive it is something to do with 'exec()' which causes problems with windows but as I don't do PHP I have no idea what the problem is or how to fix it.
I've read the PHP exec() info and all the threads on suposed fixes, but so far can't find one that works.
As you can see I've supressed all prompts from the command including output of copied files and even sent the 'xx files copied' final response from the command to NUL , I've also tried to capture any response via
but nothing seems to work and the plugin just hangs?
Any ideas how I fix this?
Thanks,
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
We purchased a site replicator plugin, only to find out it doesn't work on windows and support told me to fix it myself.
I have replaced the following line..
Code:
// copy media
$cp_base = ABSPATH . UPLOADBLOGSDIR . '/';
$cp_cmd = str_replace( '//', '/', 'cp -r ' . $cp_base . $copy_id . ' ' . $cp_base . $new_id );
exec($cp_cmd);
with...
Code:
// copy media
$cp_base = ABSPATH . UPLOADBLOGSDIR . '\\';
$cp_cmd = str_replace( '/', '\\', ' xcopy ' . $cp_base . $copy_id . ' ' . $cp_base . $new_id );
$cp_cmd .= ' /E /I /Q >NUL ';
exec($cp_cmd);
But the plugin just hangs. I beleive it is something to do with 'exec()' which causes problems with windows but as I don't do PHP I have no idea what the problem is or how to fix it.
I've read the PHP exec() info and all the threads on suposed fixes, but so far can't find one that works.
As you can see I've supressed all prompts from the command including output of copied files and even sent the 'xx files copied' final response from the command to NUL , I've also tried to capture any response via
Code:
$tmp = exec($cp_cmd);
Any ideas how I fix this?
Thanks,
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads