mkdir() failed (No such file or directory)

Reply

Join Date: May 2007
Posts: 66
Reputation: dudegio is an unknown quantity at this point 
Solved Threads: 0
dudegio dudegio is offline Offline
Junior Poster in Training

mkdir() failed (No such file or directory)

 
0
  #1
Jun 29th, 2007
Have a nice day to everyone!

Pls help me on how am i going to configure my document root and drives for the fact that i encounter this errors: pls... pls... pls...

Warning: mkdir() failed (No such file or directory) in C:\websites\pjs3\BillingRegularDetailedSave.php on line 1928

Warning
: fopen("/PJS/2007-06-29/000002.txt", "a") - No such file or directory in C:\websites\pjs3\BillingRegularDetailedSave.php on line 1935
Cannot open file (/PJS/2007-06-29/000002.txt)


Here is my code in creating directory and file.txt in doc root:

$dir1 = $_SERVER['DOCUMENT_ROOT'];
$datetoday =date("Y-m-d");
if (!file_exists("$dir1/PJS/$datetoday"))
{
$dir = mkdir("$dir1/PJS/$datetoday", 0700);
}
$result1 = mysql_query ("select bs_number, date, transactionType, subject_id, matter_id, client_id, attorney_id, rate, time, currency_nick, legalFees, fax, misc, misc_1, misc_2, misc_3, misc_4, photocopying, postage, printing, processing, telephone, transportation, vat, particulars from billingstatement") or die (mysql_error());

$filename = $_SERVER['DOCUMENT_ROOT'].'/PJS/'.$datetoday.'/'.$bsnum.'.txt';

if (!$handle = fopen($filename, 'a')) {
print "Cannot open file ($filename)";
exit;
}

if (is_writable($filename)) {

while ($row = mysql_fetch_row($result1)) {
$row_content = implode (",",$row)."\r\n";
// Write $row_content to our opened file.
if (!fwrite($handle, $row_content)) {
print "Cannot write to file ($filename)";
exit;
}
}

print "Success, content wrote to file ($filename)";

fclose($handle);

} else {
print "The file $filename is not writable";
}

Warning: unlink() failed (No such file or directory) in C:\websites\pjs3\BillingStatementRecordPerBSNumberShow.php on line 508




Here is my code for deleting a file in doc root and database.

$filename1 = $_SERVER['DOCUMENT_ROOT'].'/PJS/'.$fldbsnumdate1.'/'.$fldbsnumdelete.'.txt';

unlink($filename1);

$result2 = mysql_query("delete from billingstatementhistory where bs_number = $fldbsnumdelete");



Please help. Im fresh to Php and for sure the error is does not direct to the document root and drives for the fact that it does not trace the directory of the doc root. pls help me. im meeting my deadline. this system works before but i used xampp so they require me to use IIS so i have to configure it manually. pls help. thanks a lot...
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 138
Reputation: php_daemon is an unknown quantity at this point 
Solved Threads: 2
php_daemon php_daemon is offline Offline
Junior Poster

Re: mkdir() failed (No such file or directory)

 
0
  #2
Jul 1st, 2007
$_SERVER['DOCUMENT_ROOT'] is not defined in IIS, check this user comment on PHP Manual: http://www.php.net/manual/en/reserve...bles.php#59409
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC