473,394 Members | 1,946 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,394 software developers and data experts.

fopen function is not working in "W" mode in php

hai all

when i try create new file using fopen function in php in "W" mode. it dose not create file.

Create test.php file in /var/www/html/ directory on linux machine.

past this simple code:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $fp = fopen("newfile.file", "w") or die("Couldn't create new file");
  4.  
  5. ?>
[Please use CODE tags when posting source code. Thanks! --pbmods]

through firefox browser run above file:

ip address/test.php

example : 192.168.0.115/test.php

it show Couldn't create new file means not create file.

i have file permission as 777 also.

please any one tell me step how to run this file using browser on linux.

thanks in advance
Jun 29 '07 #1
2 5265
pbmods
5,821 Expert 4TB
Heya, doctorhardik.

See this post to find out how to turn on debugging messages so that you can find out WHY the file wasn't created.
Jun 29 '07 #2
kovik
1,044 Expert 1GB
I think I remember this same question from over at DevNetwork. I believe the same user as well. Hehe. I think it's a problem of file permissions. ;)
Jun 29 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Robert Ferrell | last post by:
I have a style question. I have a class with a method, m1, which needs a helper function, hf. I can put hf inside m1, or I can make it another method of the class. The only place hf should ever...
10
by: Dave O'Hearn | last post by:
I want to open a file for both reading and writing, but when I do "ios::in|ios::out" with an fstream, it creates the file if it doesn't already exist. I don't like that last part. C's fopen has the...
1
by: clusardi2k | last post by:
Hello, I have a shared drive on SGI, Linux, and Windows. The fact that I'm using a shared drive may be mute information. The problem is within the same program a second call to fopen does not...
2
by: foldface | last post by:
Hi Subject says it all, how can I do this? Also, do things like string functions belong to any object? i.e. are they perhaps part of the window object but are a special case? I wondering...
3
by: Ronald W. Roberts | last post by:
I'm not sure where this routine came from, but here is the problem. On certian computers this error occurs, but it does not on others. The error is: "Undefined Function "DIR" in expression". ...
7
by: clusardi2k | last post by:
Hello, I have a shared drive on SGI, Linux, and Windows. A second call to fopen doesn't create the file if it has been deleted. I would like to use fopen for its pointer return value to...
7
by: fasanay | last post by:
Hi everybody I have got the following PHP code which I am trying to convert to ASP any help will be appreciated...I have done most of it but I cant find a replace function for Unset in asp which...
6
by: murgan | last post by:
Hi people, i am new to this group,this is my first query, friends i want to know the difference between "function pointer" and "pointer to a function" in c lang, so friends please send the...
12
by: Jon Slaughter | last post by:
is there any way to simply add an attribute like feature to a function/method definition? say I create a function like function Test() { //.... }
0
by: sushanth bobby | last post by:
Hi, In the process of migration of DB2 from one version to another. We have Compatibility Mode, Compatibility Mode* Enable New-Function Mode, Enable New-Function Mode* New Function Mode....
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.