Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php中子域间的文件复制_Php - Fatal编程技术网

php中子域间的文件复制

php中子域间的文件复制,php,Php,我想将一些文件从一个子域复制到另一个子域,但没有复制文件。是否需要在php.ini文件或其他文件中启用任何选项?[来自评论] 您不能通过PHP的。至少第二个参数需要是此处的文件系统路径,而不是HTTP URL (如果配置选项allow\u URL\u fopen设置为true,则第一个参数可以是HTTP URL。)共享您正在使用的代码复制(“”); copy('http://sample.domain.com/frontend/sample_file.pdf', 'http://sam

我想将一些文件从一个子域复制到另一个子域,但没有复制文件。是否需要在php.ini文件或其他文件中启用任何选项?

[来自评论]

您不能通过PHP的。至少第二个参数需要是此处的文件系统路径,而不是HTTP URL


(如果配置选项
allow\u URL\u fopen
设置为true,则第一个参数可以是HTTP URL。)

共享您正在使用的代码复制(“”);
copy('http://sample.domain.com/frontend/sample_file.pdf',
     'http://sample-1.domain.com/frontend/sample_file.pdf');