|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-28 08:26 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 11:00:02 2025 UTC |
Description: ------------ This is my code where i create a new php file using php. I'm not able to use fopen to create the file. If i use chmod to change the permissions. It is not allowing me to do that. Warning: chmod() [function.chmod]: Operation not permitted This is the error i get if i use chmod Reproduce code: --------------- //chmod("/Library/WebServer/.../", 777); $create_file = fopen($file, "w"); $content = "1"; $fname = "/Library/WebServer/.../".$seasonx; if (is_writable($fname)) { if (!$hand = fopen($name, 'w+')) { echo "Cannot open ($fname)"; exit; } if (fwrite($hand, $content) === FALSE) { echo "Cannot write to ($fname)"; exit; } echo " success"; fclose($hand); } else { echo "The file $fname is not writable"; } Expected result: ---------------- success. [It should also create a file called 5.php where 5 is the value of the variable $seasonx at that instance Actual result: -------------- The file /Library/WebServer/...5 is not writable