通过PHP进行复制会导致URL不匹配

I have a code which would copy a file from one location to another.When I try to access the copied file,I am receiving file not found error,but the file is actually present in that location.

Location of source file:codebase\assets\default_pages\
Location of file to be copied:codebase\site_users\general\test\
Source file:home.php
Destination file:test.php[Rename while copying]

Code:Test.php[location:codebase\models\user_entry\]
copy("../../assets/default_pages/home.php","../../site_users/general/test/test.php");

When I try to access test.php,it gives me following error,

 /codebase/site_users/general/ravikanth/codebase/site_users/general/test/test.php

But when I create a file manually[without code]everything works fine.Thanks in advance for your help.

i think you must be having some sort of redirect inside your php file. can you paste the content of the file which your trying to access after copying

It could be a simple file permission problem. Try chmod command. Maybe manually you are creating/copying with root but Apache or whatever the PHP runs on does not have a permission.