Hi

I currently have a php page, containing only the following code between the BODY tags (same problem if I put it between the HEAD tags):

<?php

$v = "try.txt";
touch("$v");

?>

I run this locally, on a Windows Me machine, so no problems with file ownership and privileges. When I run the script, the empty file try.txt is created, as it should be, but it always returns the following error as well:

Warning: utime failed: Invalid argument in e:\webserver\www\test.php on line 18

(Line 18 is the one that says touch("$v"); )

Does anyone know what this error means and how I can prevent it?

Thanks
Stille

    you certainly don't need the quotation marks around the variable (touch($v) is enough). Don't know if thats the problem though.

      Thx for the quick reply. I tried it without quotation marks, but it does the same (creates the file but still gives an error)...

        The one I mentioned above:

        Warning: utime failed: Invalid argument in e:\webserver\www\test.php on line 18

          Try running the touch function with the fully qualified path. Note that in windows you have to bypass with two slashes:

          touch("C:\Path\To\File\try.txt") or die("Didnt work again");

            Originally posted by hearn
            Try running the touch function with the fully qualified path. Note that in windows you have to bypass with two slashes:

            touch("C:\Path\To\File\try.txt") or die("Didnt work again");

            That gives the same result. I also need this script to be portable to other servers, so I need to use relative pathnames.

              Originally posted by dannys
              What version of PHP are you running? This has appeared on the PHP bugs list as a bug in PHP4.2.0 but has since been fixed.

              http://bugs.php.net/bug.php?id=16835

              It looks like this is indeed the cause of the problem. I currently use Easyphp (www.easyphp.org), which uses PHP 4.2.0 in its most recent version.

              I'll try to get in touch with them to get this fixed. Thanks!

              Does anyone know a great alternative to Easyphp? I'm looking for something that supports PHP and MySQL. Stable and easy-to-install (self-extracting .exe preferably) for Windows.

              Thx!

                You might be able to download the latest Windows binaries from PHP.net - with any luck you'll be able to install the files the same place easyPHP installed them.

                Latest version is 4.2.3 btw.

                  Write a Reply...