copy command and dotfiles
Posted by: neo314 (
Date: April 19, 2024 05:38AM

Anyone have any advice on this maddening issue that complicates my development server?

I am using WAMP on Windows 11 with SSL for Joomla 5.0.3 development. WAMP is running Apache 2.4.58 with PHP 8.1.26

Everything works fine except I cannot install extension updates or Joomla updates.

I have determined that in the file Filesystem\Folder.php, each installation is proceeding just fine until it reaches an .htaccess file and then it fails with a permissions error. The thing is, I have done everything with windows permission possible on this, and there is no specific permission associated with the .htaccess file in question, so it seems like PHP/Apache must just be deciding that it does not have permission to manipulate dot-files.

The error is occurring in Filesystem\Folder.php at line 147-148.

if (!@copy($sfid, $dfid)) {
throw new \RuntimeException('Copy file failed', -1);

I can watch all the files successfully copy until an .htaccess file comes up and then it throws the exception. This does not happen on my Ubuntu development server nor on my cPanel/CentOS7.9 server.

Anyone have an idea why this might be happening in the windows/WAMP environment or how I can correct it?

Thanks for any feedback.


Options: ReplyQuote
Re: copy command and dotfiles
Posted by: Otomatic (Moderator)
Date: April 19, 2024 09:09AM

You know that copying doesn't work, but you don't know why.
With if (!@copy($sfid, $dfid)), copy function errors are hidden.

It would be a good idea to try removing the @ symbol: if (!copy($sfid, $dfid)) and look at the error messages in php_error.log.

It may also be that instructions in the .htaccess file prevent copying.

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote

Sorry, only registered users may post in this forum.