- 新秘
- 廠商評價
新秘推薦
EDIT: Austin below in the comments resolved my issue. How do I close the question since that is the answer?
I have the following simple code to open/write to a query file on my server. I've checked permissions and even set +rw for all users on the query file, yet I still get the error
failed to open stream: resource temporarily unavailable
in my apache error log.
I'm not really sure what I can do to alleviate this issue, thoughts?
<?php
// filepaths
$queryFile = '../query/query.txt';
// get query
$query = $_GET['searchBox'];
// open and write query to query file
$fh = fopen($queryFile, 'X') or die("Can't open file");
fwrite($fh, $query);
fclose($fh);
linux apache php
shareimprove this question
edited Nov 19 '12 at 0:17
hakre
154k28284563
asked Nov 18 '12 at 23:58
ripit
39011022
- Check out: file_put_contents() – Gaui Nov 19 '12 at 0:01
-
1
Are you sure the current working directory is what you think it is? What happens if you prepend
dirname(__FILE__)
to$queryFile
? – staticsan Nov 19 '12 at 0:02 - 2
加入最愛
檢舉文章
Line分享
FB分享