简体   繁体   English

php copy()可在ecplise CLI环境中使用,但不适用于Web浏览器

[英]php copy() works on ecplise CLI environment, but does not work with web browser

copy() function does not work in web browsers, but it works with CLI environment!! copy()函数在Web浏览器中不起作用,但可在CLI环境中使用!

I already checked the file permission and /etc/php5/apache2/php.ini file to check whether copy() is listed on the disable_functions. 我已经检查了文件许可权和/etc/php5/apache2/php.ini文件,以检查disable_functions上是否列出了copy()。 But it is not listed there :( 但是这里没有列出:(

My os is debian by the way. 我的操作系统是debian。 Thanks~ :) 谢谢〜:)

You need to make sure that the files your moving are accessible by the user running the Apache application. 您需要确保运行Apache应用程序的用户可以访问移动的文件。

Apache usually runs as www-data:www-data, changing the file to 777 permissions (chmod 777 filename). Apache通常以www-data:www-data的身份运行,将文件更改为777权限(chmod 777文件名)。 Also ensure that the directory permissions allow access as well. 还请确保目录权限也允许访问。

You shouldn't leave the permissions as 777 as this leaves the system open to all sorts of abuse. 您不应将权限保留为777,因为这会使系统易于遭受各种滥用。 There is some very good documentation and very lengthy details about this here 有关于这一些很好的文档和非常漫长的细节在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM