At 11:14 PM 3/28/2011, Adam Richardson wrote:
On Mon, Mar 28, 2011 at 11:03 PM, Ethan
Rosenberg <<mailto:ethros@xxxxxxxxxxxxx>ethros@xxxxxxxxxxxxx> wrote:
At 01:32 AM 3/28/2011, Hans Ã?hlin wrote:
Do you have SELinux installed?
2011/3/28 Ethan Rosenberg <<mailto:ethros@xxxxxxxxxxxxx>ethros@xxxxxxxxxxxxx>:
> Dear List -
>
> Thanks for all your help in the past. Â Here is another one...
>
> I am getting a Permission Denied" message
when I try to run a PHP script. Â I
> just changed the mode on the directory and the files to 777. Â This problem
> arose when I changed the permissions. Â I thought I was solving a problem,
> because I could not open a file for writing. Â I was not receiving error
> messages, but no file was created.
>
> Help and advice, please.
>
> Ethan Rosenberg
>
>
>
**********************************************
 Hans �hlin
  Tel: +46761488019
  icq: 275232967
  <http://www.kronan-net.com/>http://www.kronan-net.com/
  irc://<http://irc.freenode.net:6667>irc.freenode.net:6667 - TheCoin
**********************************************
Hans -
Sorry, I did not include my signature, which
includes all the requested information.
Here it is....
Ethan
==========
MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)]
The problem persists. I cannot write to a file from PHP.
Any more suggestions?
Thanks.
Ethan
Hi Ethan,
Are you using suPHP or suExec? I believe the
server chokes on 777 permissions in those cases.
Have you checked the permissions in the command
line (sorry for the basic question, but just
making sure I know what you've already done?)
Also, can we see some of the code you're using to handle the file processing?
Thanks,
Adam
--
Nephtali: A simple, flexible, fast, and security-focused PHP framework
<http://nephtaliproject.com>http://nephtaliproject.com
+++++++++
Adam -
Thanks.
1] Pardon my ignorance but I do not understand
this - Are you using suPHP or suExec?
2] I changed the permissions to 755 and the
"Permission Denied" message went away.
3] Have you checked the permissions in the command line? Yes
4] Here are some code snippets:
$fptr1 = fopen("chessboard", "r+"); //this works
$fptr2 = fopen('chessboard', 'w'); //this deletes the file, as it should
for($i = 0; $i <8; $i++)
{
for ($j = 0; $j < 8; $j++)
fprinf($fptr2, "%s ", $results[$i][$j]);
fprinf($fptr2, "\n");
} //this never writes, so I am left with an empty file
// I tried the following two code blocks, and the
output files were never created.
$number = 123;
$file = fopen("test.txt","w");
fprintf($file,"%f",$number);
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Bobby Bopper\n";
fwrite($fh, $stringData);
$stringData = "Tracy Tanner\n";
fwrite($fh, $stringData);
fclose($fh);
Ethan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php