Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming graphics hard drive hardware hdmi internet laptop malware memory monitor motherboard network operating system printer problem ram registry router slow software sound svchost.exe trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
[Ubuntu Linux Server] Trouble writing files

Reply  
Thread Tools
lumentec's Avatar
Computer Specs
Member with 101 posts.
 
Join Date: Mar 2008
Experience: Advanced
11-May-2009, 08:28 AM #1
[Ubuntu Linux Server] Trouble writing files
First, specs:
OS: Ubuntu Linux Server Edition (Jaunty Jackalope) 9.04 32bit i386
GUI: Terminal, Kubuntu-desktop, and Ubuntu-desktop available
HDD: 60 GB
Internet: eth0 connected, working
SSH: OpenSSH through PuTTY
Software: Apache 2, PHP 5

So, it seems when I try to write to a file with PHP, the file writes for only a few seconds, or until the script finishes. I have error reporting set to E_ALL & ~E_NOTICE in PHP and I ran sudo chmod 775 /var/www for permissions.

Here's the code:
HTML Code:
$myFile = "total.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
$theData=(int)$theData;

$myFile = "total.txt";
$fh = fopen($myFile, 'w') or die("Error... please reload or contact admin.");
$stringData = $theData+$temp;
fwrite($fh, $stringData);
fclose($fh);

Thanks!
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:50 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.