Forum

Thread tagged as: Problem

Working Locally with Perch

I'm developing locally with Perch using MAMP. In the root directory of the local server there are various directories containing different websites.

I'm trying to install Perch on one of the websites. Perch seems to function fine when added to existing pages, however when creating new pages it writes the new pages to the root of the local server, not the directory containing the Perch website.

I have modified the PERCH_SITEPATH (actual path changed)

define('PERCH_SITEPATH', '/Volumes/drive/websites/site_name/site-folder/');

This gets Perch to write the file to the correct directory, however when the file is viewed I get the following error:

Warning: include(../../site_name/perch/templates/pages/default.php): failed to open stream: No such file or directory in /Volumes/drive/websites/site_name/site-folder/ tester.php on line 1

Can Perch only function in the root folder of the server? Or is there a setting I am overlooking somewhere?

Tony Astley

Tony Astley 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You don't want to work in a subfolder as when you deploy the site it will not be in a subfolder so all your page paths will be incorrect.

Look up how to create virtualhosts in Mamp, so each site can have its own root.

Thanks,

I will look into it. I normally work locally in a CMS, then replace the relevant paths in the site/DB prior to publishing.

Guess this isn't an option in Perch?

Drew McLellan

Drew McLellan 2638 points
Perch Support

It's not a way we'd suggest working.