Jump to content

PHP copy() failed to open stream error


Dazzozo

Recommended Posts

Hey! I'm trying to make a file copy in to another directory, but I get a failed to open stream error.

 

Here is the error I am getting.

 

Warning: copy(http://dazzozo.com/test/index.php) [function.copy]: failed to open stream: HTTP wrapper does not support writeable connections. in /home/dazzozo/public_html/sourcefolder/test.php on line 7

An error occured.

 

This is the PHP code that is being used.

 

<?php

$subdomain = "test";
$sourcefile = "index.php";
$destinationfile = "http://$subdomain.dazzozo.com/index.php";
                
   if(copy($sourcefile, $destinationfile)) {
      echo "Copying successful.", "\n";
   } else {
      echo "An error occured.", "\n";
   }
               

?>

 

The PHP file this is in is called 'test.php', and the file it is trying to copy is 'index.php' from 'sourcefolder' to 'test'.

 

Why am I getting this error?

Thanks,

Dazzozo.

Link to comment
https://forums.phpfreaks.com/topic/107802-php-copy-failed-to-open-stream-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.