This is a discussion on Best way of copying a single file to multiple directories? within the Linux Web Servers forums, part of the Web Server and Related Forums category; Hi This might sound trivial but read on... I'm trying to install a (PHP-MySQL based) content management system ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi
This might sound trivial but read on... I'm trying to install a (PHP-MySQL based) content management system on my ISP's Unix server. Turns out I need a custom php.ini file in each directory that contaings php files. That might sound trivial but belive me there are a few (!). It also took a while to upload all the files in the first place... What would the best way of copying my new php.ini file to all directories in a directory tree be? Best Regards Peter |
|
|||
|
Peter Szmulik <peter@szmulik.com> wrote:
> [...] I need a custom php.ini file in each > directory that contaings php files. That might sound trivial but > belive me there are a few (!). It also took a while to upload all the > files in the first place... > What would the best way of copying my new php.ini file to all > directories in a directory tree be? I'd suggest that maybe a good way forward would be to create a local copy of the installation. You can then use a file transfer program that understands recursive copying to transfer the entire directory tree in "one" operation. To install a file in each directory within a tree, I'd use a command line utility. The unix-style "find" command could be used to do this (there are versions of it for Windows platforms, too): cd top-of-directory-tree find * -type d -exec cp -p /path/to/source/php.ini {} \; For a Windows platform you'd use "copy" in place of the "cp -p". Chris |
|
|||
|
Peter Szmulik <peter@szmulik.com> wrote:
> [...] I need a custom php.ini file in each > directory that contaings php files. That might sound trivial but > belive me there are a few (!). It also took a while to upload all the > files in the first place... > What would the best way of copying my new php.ini file to all > directories in a directory tree be? Assuming you have command line access to your server, you can use a command like "find" to do this: cd /top/of/tree find * -type f -exec cp -p /source/to/original/php.ini {} \; If you don't have command line access, then I'd suggest that the way forward is for you to create a local directory structure that matches your bit of your ISP's server. Put all your files in the local tree and then use a file transfer program that understands recursive copies to transfer the entire lot in "one" operation. There are Windows (and probably Mac) versions of "find" available, so you can populate the local directory tree easily, regardless of OS. Chris |