I am currently building a gallery web application using php. I am currently developping on windows but the deployment server is running unix.
Each gallery will have its own folder, from which the name of the gallery is derived (ie if the folder is “nature”, that will be the gallery’s name.
Now, when i try to rename a gallery, say for eg, i do
rename("img/old_gallery","img/new_gallery");
//where img is a folder relative to this php script (rename.php)
it works under perfectly under windows. Under unix though, i get the following error:
Warning: rename(img/old_gallery ,img/products/new_gallery) [function.rename]: No such file or directory in ~server_name~/public_html/rename.php on line 5
I thought maybe its the underscore, and tried names like “new” and “old”, still same result, works on windows, but on the server doesn’t. Anyone has any idea of what could be the problem?
ps. if it matters, i am using the latest xampp for windows, with php 5.3, whereas the server has php 5.29 installed. could it be the source of the problem?
thanks 🙂
Your error message also has a space after “img/old_gallery” for some reason; is that meant to be there? Are you sure you’re not accidentally trying to delete “img/old_gallery ” (note the space) instead?