#50865 [Opn->Bgs]: I'm Not able to create a file using fopen
| From: | jani@php.net | Date: | Thu, 28 Jan 2010 08:26:01 +0000 |
| Subject: | #50865 [Opn->Bgs]: I'm Not able to create a file using fopen | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-147021@lists.php.net to get a copy of this message | ||
ID: 50865
Updated by: jani@php.net
Reported By: kv_abhiram at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Apache2 related
Operating System: Leopard 10.6
PHP Version: 5.2.12
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2010-01-27 20:18:32] kv_abhiram at yahoo dot com
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50865&edit=1