PHP copy and file ownership

Posted by & filed under Linux.

Came across a taxing problem installing Joomla component on an old 1.05 installation. The error was:

Warning: copy(/home/example.com/public_html/home/administrator/components/com_rd_rss/rd_rss.xml) [function.copy]: failed to open stream: Permission denied in /home/ucbmedia/public_html/home/administrator/components/com_installer/installer.class.php on line 360

Failed to copy file: /home/example.com/public_html/home/administrator/components/com_installer/component/rd_rss/rd_rss.xml to /home/example.com/public_html/home/administrator/components/com_rd_rss/rd_rss.xml

The problem was caused by ownership. PHP was running in fast-CGI mode as user ‘nobody’. But the user logged into the example.com was ‘example’.

I logged into the server as root and changed ownership of the the target directory (and the source for good measure), and all was well.

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Bitnami