Edit report at http://bugs.php.net/bug.php?id=51433&edit=1

 ID:               51433
 Comment by:       imaggens at gmail dot com
 Reported by:      ggens at gmail dot com
 Summary:          file_put_contents() doesn't overwrites a existent file
 Status:           Feedback
 Type:             Bug
 Package:          Filesystem function related
 Operating System: Windows XP SP3
 PHP Version:      5.3.2

 New Comment:

Well, the CLI results:



== Begin CLI Code ==



<?php



ini_set( 'display_errors', TRUE );



error_reporting( E_ALL | E_STRICT );



$path = 'C:\Arquivos de
programas\Zend\Apache2\htdocs\ca\library\Insight\FileSystem\File\Adapter/PHP/Templates\CLASS';



$file = 'C:\Arquivos de
programas\Zend\Apache2\htdocs\ca\users\Insight\test.php';



file_put_contents( $file, file_get_contents( $path ) );



?>



== End CLI Code ==



Results

=======



When the file in $file doesn't exist, the file is created succesfully.

When the file already exist, no matter how many times I run the code
under CLI, the content of file doesn't changes.



Expected Results

================



Content of file updated.



Extra Information

=================



The presence of two types of slashes doesn't affects the result. Even I
replace all '/' by '\' (Windows Slash) the results are the same.


Previous Comments:
------------------------------------------------------------------------
[2010-03-30 13:59:05] paj...@php.net

And enable the error_reporting and show error as well, as I'm pretty
sure you get a nice error message (permissions or stmg like that).
Alternatively check your error log.



If you don't how to do it, please go to the Zend support forums or to
the PHP general mailing list.

------------------------------------------------------------------------
[2010-03-30 13:57:56] paj...@php.net

Open a console:



cd c:\where\is\php

php.exe yourscript.php

------------------------------------------------------------------------
[2010-03-30 13:42:23] imaggens at gmail dot com

I don't know how to use CLI, and it's not a Zend Server problem.

------------------------------------------------------------------------
[2010-03-30 13:34:40] johan...@php.net

And please use our PHP builds. For support for Zend Server please got to
Zend.

------------------------------------------------------------------------
[2010-03-30 11:16:08] paj...@php.net

Can you try a small script using CLI?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

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


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51433&edit=1

Reply via email to