$config->setPath() method

Change or set just the server disk path for the named location (leaving URL as-is)

  • If you want to update both disk path and URL at the same time, or if URL and path are going to be the same relative to installation root, use the setLocation() method instead.

  • Paths relative to PW installation root should omit the leading slash, i.e. use site/templates/ and NOT /site/templates/.

  • The $for argument can be: cache, logs, files, tmp, templates, or one of your own. Other named locations may also work, but since they can potentially be used before PW’s “ready” state, they may not be reliable.

Available since version 3.0.141.


$self = $config->setPath(string $for, string $path);



Named location from $config->paths, one of: cache, logs, files, tmp, templates, or your own.


Path relative to PW installation root (no leading slash), or absolute path if not.

Return value



Method can throw exceptions on error:

  • WireException

$config methods and properties

API reference based on ProcessWire core version 3.0.160

Twitter updates

  • ProcessWire 3.0.161 adds support for selector operator stacking, enabling you automatically broaden searches in a single pages.find() call— More
    26 June 2020
  • ProcessWire 3.0.160 adds powerful new text-searching operators, bringing a new level of power to page-finding API calls, especially when it comes to search engine type queries. Post also includes a demo search engine where you can test it all out live— More
    19 June 2020
  • Preview of ProcessWire 3.0.160 with auto-enable of two-factor authentication, new version of TfaEmail and TfaTotp, and new selector operators coming next week. More
    12 June 2020

Latest news

  • ProcessWire Weekly #320
    In the 320th issue of ProcessWire Weekly we're going to check out the latest core updates (ProcessWire 3.0.161), a new third party module called Fieldtype Runtime only, an IndieWeb themed article from Francesco Schwarz, and more. Read on!
    Weekly.pw / 27 June 2020
  • Powerful new text-searching abilities in 3.0.160
    In ProcessWire 3.0.160 we’ve got some major upgrades and additions to our text-search abilities. This brings a whole new level of power to $pages->find() and similar API calls, especially when it comes to search engine type queries.
    Blog / 19 June 2020
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH