I installed PHP Version 5.1.4 on Apache SSL 2.2.2 fom Apachelounge.com on my Windows XP PRO SP2 and my server adds a little php script to track hits. The php script would add a hit to a text file anytime a page gets called. The problem is, I guess, that php cannot write to that file because the counter wouldn't progress after hits. even if I delete the tracking file, the script cannot create the file. Under linux the script was running fine with the same settings. Can somebody help? Since Windows doesn't have user rights, how can I give permission to php create files?

what about php not being able to write to existant files? I don't think it is a script problem, since the same scripts were working on linux. I guess it is more a php setup or maybe an access right problem.

if you don't post the original error message I can only guess.
Do you use fopen? You didn't told me! Post the script! Without informations I still guess.
Normaly PHP can write files in Windows. What about the permissions? Set by the script? In Windows you have to use 0666 and not 0777. If you use 0777 the file will under Windows not writeable only readable.
Was the textfile importet from linux or created on Windows`?

Another reason an be, if you run Apache as service maybe the User under the service is running has not the permissions to write files.

Potentially, could be a '$path' statement (in the PHP script) that is still pointing to the old path that you used in Linux.

drmed,
You act like you know the answer to your question, but yet you still ask. Why?
James tries to get the ball rolling by asking a good question, and you dismiss him saying that the script is not the problem. Are you absolutely sure?

Let's see - by your own admission you said:

-that you had been running this script on a Linux box without problems [HINT]
-now, it is not functioning under Windows [HINT]

How does your script know where to find or write a new file - PFM (pure freaking magic)?

Maybe someone can help me - I'm in a place with no light. Is it that there is no light or are my eyes giving me trouble? It must be my eyes because I used to be able to see light. That's logic...
..
.

Excuse my ignorance but how do I set permissions for folders/files under windows xp pro? Under linux I used CHOWN/CHMOD but no clue under XP. Can you help me how to change permissions to 0666?

I will post the script tomorrow since I am currently not home and don't have access to my server.

The text file has been created on linux and has been copied to windows but even after deleting the file, the script still cannot create a file under windows.

My php.ini shows to C:\PHP\php.ini, so I guess it is reading the right ini file.

Dear pnllan, there is no need to be a smart%$%. I was just trying to logically figure out what is going on. I didn't dismiss anybodies help either. All I said was working scripts under linux stopped working under windows. Therefore there is a different configuration/user access setting that has to be changed and I have no clue where/what this is.

Use Windows Explorer and navigate to the folder containing 'count_data.txt'. Right Click the file and select Properties. If the file is set to read only then uncheck and give it a try.

As far as phpmyadmin goes, if you are using MySQL 4.01 or higher you should use the MySQLi extension - according to the phpmyadmin documentation. I have used phpmyadmin for along time on Windows, and have NEVER had an issue with FILE PERMISSIONS.

I have no expereince with bbclone.

You have three distinct issues (writing to the count file, inop phpmyadmin, and bbclone)...Anything else not right?

Hello Tester!
I wasn't able to read the code! The many many letters are in a language my system couldn't read. Of cause I could read the html, but I wasn't able to read the name of the variables, name of input fields and so on.

Than you work without $_POST or $_GET variables. So I guess you work with register globals = on. But even if I turn that on. I don't see input fields.

Using php i can fread on my pc's server but fwrite doesn't work.
However, i upload the code to the webhost and the same thing works perfectly.

How to fix it?

Perhaps the windows file permission is causing the error, its set to Everyone right now. I searched everywhere, people say that there is usually no need to change permission for folders if you are using apache on windows, if thats the case, what can be the problem?