In my program I need to copy a file to a new file. I'm using the following php code to change the folder permission and copy existing file test.php to a new file (not already created) test_1.php.
exec('chmod -R 0777 /folder1/');
exec('sudo cp /folder1/test.php /folder/test_1.php');
But this is not creating and copying the test_1.php file.
Can anyone help me to fix this? Thanks in advance.