yolop Posted November 22, 2008 Share Posted November 22, 2008 i run this file <?php copy('2.php','7.php' ); chmod('7.php',0777); ?> and it's copy 2.php to 7.php good i even give to file 0777 now i edit 7.php and put that code <?php include('./user.php'); ?> and i got some error Warning: include() [function.include]: SAFE MODE Restriction in effect. The script whose uid is 100 is not allowed to access ./user.php owned by uid 627 in /home/*****/domains/****.co.il/public_html/7.php on line 3 Warning: include(./user.php) [function.include]: failed to open stream: Not a directory in /home/*****/domains/*****.co.il/public_html/7.php on line 3 Warning: include() [function.include]: Failed opening './user.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/*****/domains/*****.co.il/public_html/7.php on line 3 now....if i run file (that not create from copy) with the same code it's work well what is the problem???? thank Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/ Share on other sites More sharing options...
revraz Posted November 22, 2008 Share Posted November 22, 2008 ../user.php Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696467 Share on other sites More sharing options...
yolop Posted November 22, 2008 Author Share Posted November 22, 2008 same problem look I said if i run file (that not create from copy) with the same code it's work well so the proble not in the code Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696474 Share on other sites More sharing options...
Mark Baker Posted November 22, 2008 Share Posted November 22, 2008 The owner of file 2.php is the owner with uid 627. Copying it creates a file 7.php whose owner has uid 100. You could try chown() to reset the owner of 7.php after the copy, although if safe mode is in effect it probably wouldn't permit you to do so. Out of interest, why are you copying php scripts from within your code anyway? Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696480 Share on other sites More sharing options...
yolop Posted November 22, 2008 Author Share Posted November 22, 2008 how??? i tried <?php $user_name = "root"; chown('7.php', $user_name); ?> but error Warning: chown() [function.chown]: Operation not permitted Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696490 Share on other sites More sharing options...
yolop Posted November 22, 2008 Author Share Posted November 22, 2008 or if Iwrite chown('7.php', '100'); error Warning: chown() [function.chown]: Unable to find uid for 100 in or i tried to do <?php // File name and username to use $file_name= "7.php"; $path = "/home/***/domains/****.co.il/public_html/**/***/" . $file_name ; $user_name = "root"; // Set the user chown($path, $user_name); // Check the result $stat = stat($path); print_r(posix_getpwuid($stat['uid'])); ?> error Warning: chown() [function.chown]: Unable to find uid for 100 in /home/****/domains/****/public_html/****/****/2.php on line 10 Array ( [name] => apache [passwd] => x [uid] => 100 [gid] => 501 [gecos] => [dir] => /var/www [shell] => /bin/false ) Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696494 Share on other sites More sharing options...
yolop Posted November 22, 2008 Author Share Posted November 22, 2008 my massage edit Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696536 Share on other sites More sharing options...
yolop Posted November 23, 2008 Author Share Posted November 23, 2008 someome please??? Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696685 Share on other sites More sharing options...
Mark Baker Posted November 23, 2008 Share Posted November 23, 2008 but error Warning: chown() [function.chown]: Operation not permitted As I said before (note the emphasis), You could try chown() to reset the owner of 7.php after the copy, although if safe mode is in effect it probably wouldn't permit you to do so. Now perhaps if you answer my other question: Out of interest, why are you copying php scripts from within your code anyway? We might be able to come up with a solution to your problem that doesn't require cloning PHP files, which might bypass your file ownership problem completely Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-696928 Share on other sites More sharing options...
yolop Posted November 25, 2008 Author Share Posted November 25, 2008 but error Warning: chown() [function.chown]: Operation not permitted As I said before (note the emphasis), You could try chown() to reset the owner of 7.php after the copy, although if safe mode is in effect it probably wouldn't permit you to do so. Now perhaps if you answer my other question: Out of interest, why are you copying php scripts from within your code anyway? We might be able to come up with a solution to your problem that doesn't require cloning PHP files, which might bypass your file ownership problem completely In my system i open subdomain for peopels that i register them and in every subdomain i pu some php files that include the file from the system so that is my problem thank Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-698606 Share on other sites More sharing options...
yolop Posted November 25, 2008 Author Share Posted November 25, 2008 someone know? Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-698652 Share on other sites More sharing options...
yolop Posted November 25, 2008 Author Share Posted November 25, 2008 hi please Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-698871 Share on other sites More sharing options...
yolop Posted November 27, 2008 Author Share Posted November 27, 2008 ? Link to comment https://forums.phpfreaks.com/topic/133824-problem-with-copy-file/#findComment-700331 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.