i examined different ways to write files in PHP manual but unsuccessful.
at the moment, the possible reasons due to the problem, i suppose, should be lying on the code below:
===========================================================================
Code: Select all
file_write("xxxx.rss", "we wish you a merry xmsn.");
function file_write($filename, $content) {
if (!is_writable(realpath($filename))) {
if (!chmod(realpath($filename), 0666)) {
echo "Cannot change the mode of file ($filename)";
exit;
}
}
/* let's omit this coz the program would terminate before executing here */
}it displays the warning msg: "cannot change the mode of file"
which means, not only i cannot write files
i even cannot "CHMOD"!
could any experts here kindly tell me why it is happening?
really thanks a lot coz i am so frstrated in this what i call "fopen() disaster".
p.s. by the way,
at the same moment, i found my PHP script also cannot use "exec_shell()" too
are the two problems any relation?p;quote;, "we wish you a merry xmsn."e;);
function file_write($filename, $content) {
if (!is_writable(realpath($filename))) {
if (!chmod(realpath($filename), 0666)) {
echo "e;Cannot change the mode of file ($filename)"e;;
exit;
}
}
/* let's omit this coz the program would terminate before executing here */
}
=========================================================================
it displays the warning msg: "cannot change the mode of file"
which means, not only i cannot write files
i even cannot "CHMOD"!
could any experts here kindly tell me why it is happening?
really thanks a lot coz i am so frstrated in this what i call "fopen() disaster".
p.s. by the way,
at the same moment, i found my PHP script also cannot use "exec_shell()" too
are the two problems any relation?ible reasons due to the problem, i suppose, should be lying on the code below:
===========================================================================
Code: Select all
file_write("xxxx.rss", "we wish you a merry xmsn.");
function file_write($filename, $content) {
if (!is_writable(realpath($filename))) {
if (!chmod(realpath($filename), 0666)) {
echo "Cannot change the mode of file ($filename)";
exit;
}
}
/* let's omit this coz the program would terminate before executing here */
}it displays the warning msg: "cannot change the mode of file"
which means, not only i cannot write files
i even cannot "CHMOD"!
could any experts here kindly tell me why it is happening?
really thanks a lot coz i am so frstrated in this what i call "fopen() disaster".
p.s. by the way,
at the same moment, i found my PHP script also cannot use "exec_shell()" too
a
file_write("xxxx.rss", "we wish you a merry xmsn.");
function file_write($filename, $content) {
if (!is_writable(realpath($filename))) {
if (!chmod(realpath($filename), 0666)) {
echo "Cannot change the mode of file ($filename)";
exit;
}
}
/* let's omit this coz the program would terminate before executing here */
}
=========================================================================
it displays the warning msg: "cannot change the mode of file"
which means, not only i cannot write files
i even cannot "CHMOD"!
could any experts here kindly tell me why it is happening?
really thanks a lot coz i am so frstrated in this what i call "fopen() disaster".
p.s. by the way,
at the same moment, i found my PHP script also cannot use "exec_shell()" too
are the two problems any relation?