| | |
mkdir() failed (No such file or directory)
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2007
Posts: 66
Reputation:
Solved Threads: 0
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...
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...
•
•
Join Date: Aug 2006
Posts: 138
Reputation:
Solved Threads: 2
$_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
![]() |
Similar Threads
- No such file or directory (C)
- uploaded file moving to new directory (PHP)
- Open In New Window Php (PHP)
- HELP! I get an erro when including PEAR.php file (PHP)
- I get the error no file or directory when i try to run a perl script (Perl)
- HTTP Error 404 - File or directory not found. (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: novice needs help setting a membership up
- Next Thread: Software Developer Needed - Midi file converter to .lmz
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code codingproblem cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select send server sessions sms snippet soap source space speed sql static structure syntax system table tutorial up-to-date update upload url validation validator variable video web wordpress xml youtube





