473,395 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

touch and fopen command

Hi,
I am kind of new to PHP and while learning I came across the touch
command which creates a new file. I also came up with fopen to open a
file. In both cases I am having the same problem:

Source Code:

<?
$fp=fopen("secondfile.txt", 'w');
fclose($fp);
?>

Result:

Warning: fopen(secondfile.txt) [function.fopen]: failed to open
stream: Permission denied in c:\Inetpub\wwwroot\test.php on line 2
Warning: fclose(): supplied argument is not a valid stream resource in
c:\Inetpub\wwwroot\test.php on line 3

I am running windows xp professional sp2 with localhost. I don't have
any problems reading a file. Its writing where I am having problems.
Any help is appreciated. Thanks

May 27 '07 #1
3 2602
ni*********@gmail.com kirjoitti:
Hi,
I am kind of new to PHP and while learning I came across the touch
command which creates a new file. I also came up with fopen to open a
file. In both cases I am having the same problem:
....
stream: Permission denied in c:\Inetpub\wwwroot\test.php on line 2
You've not granted write permission for the webserver user to the
directory where you are trying to create a file. It's usually helpful to
read the error messages.

--
Ra*********@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
May 27 '07 #2
You've not granted write permission for the webserver user to the
directory where you are trying to create a file. It's usually helpful to
read the error messages.

--
Yes I know that but how do I fix that problem in localhost? In other
words, how do I grant write permission for the webserver user to the
directory where I am trying to create the file?

May 28 '07 #3
ni*********@gmail.com wrote:
>You've not granted write permission for the webserver user to the
directory where you are trying to create a file. It's usually helpful to
read the error messages.

--

Yes I know that but how do I fix that problem in localhost? In other
words, how do I grant write permission for the webserver user to the
directory where I am trying to create the file?
This is an OS administration task. You might check the documentation
for Windows XP and/or microsoft.com. Learn about the security features
for XP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 28 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Shaoyong Wang | last post by:
Dear All, I want to write a simple PHP code to verify whether a given list of URLs is broken or not. The URLs given have various formats, for example, http://www.afro.com/history/history.html...
5
by: pekka niiranen | last post by:
Does anybody know Python recipe for changing the date of the directory or files in W2K to current date and time? In UNIX shell command "touch" does it. -pekka-
10
by: Kenneth McDonald | last post by:
I could've sworn python had such a command, but now I can't find it... I'm looking for an easy way to perform a UNIX-style "touch", to update the modification time of a file without actually...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
6
by: rfhurley | last post by:
I'm a newbie at this... I'm trying to run a PHP script from the W3C PHP tutorial, and the example shows the following code: <html> <body> <?php $file=fopen("welcome.txt","r"); ?>
25
by: subramanian100in | last post by:
Consider the following program: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv) { if (argc != 2) { printf("Usage: <program-name<text-file>\n");
3
by: brino | last post by:
hi all ! i have a database working on a touch screen. on one of the forms i would like to place some buttons with all numbers so you can enter a numeric value in without using the keyboard. ie....
1
by: =?Utf-8?B?dmNs?= | last post by:
Short version: IE7 and .NET Framework 2.0 breaks no touch deployment for .NET 1.1 applications. IE6 and .NET Framework 1.1 + 2.0 works fine. IE7 with .NET Framework 1.1 only is fine, once we add...
11
AutumnsDecay
by: AutumnsDecay | last post by:
Hey there. I've been implimenting FCKEditor into my clients websites so they can update the text and pictures on their own. The way it is currently setup is that you need to 'login' to gain...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.