Forum

Thread tagged as: Problem

Mamp Pro issues showing Perch site

Hi,

This is not a Perch problem, so sorry for being off topic, however, I wonder if other Perch users are experiencing the same issues I am? I tried Mamp Pro support, who basically said they had never heard of Perch and then just said it was a problem Perch. Which I'm very confident it isn't.

I am trying to load a Runway site with Mamp Pro. I am not doing anything I didn't do for the other three Runway sites I successfully installed before Christmas.

All Mamp Pro settings from the new site match those of the old working sites. However, trying to load Perch site results in a 'You don't have permission to access / on this server.' error.

My .htaccess file looks like this on every install

# Perch Runway
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/perch
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /perch/core/runway/start.php [L] 

Mamp pro's php log prints the following…

[22-Jan-2018 18:10:35 Europe/London] PHP Warning:  include(): Failed opening '/Users/Grant/Sites/119-Stokesley-Council/public/core/index.php' for inclusion (include_path='.:/Applications/MAMP/bin/php/php7.1.8/lib/php') in /Users/Grant/Sites/119-Stokesley-Council/public/index.php on line 3

As Rachel pointed out in another post of mine when I thought this might be licence issue. The links in the above are wrong.

/Users/Grant/Sites/119-Stokesley-Council/public/core/index.php should be /Users/Grant/Sites/119-Stokesley-Council/public/perch/core/index.php

Problem is, I have no idea how to resolve the issue.

I've tried reinstalling several times, and every time the same issue. I am wondering if a recent update to Mamp Pro may have changed something in the background that means new installs for some reason suffer the above issue. Hence wondered if anyone else has run into this issue.

Thanks in adavnce

Grant Smith

Grant Smith 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Grant,

Do you by any chance have theindex.php in /public instead of /public/perch?

Shouldn't .../119-Stokesley-Council/public/index.php be .../119-Stokesley-Council/public/perch/index.php?

Hi Hussein,

The link you're referencing to is incorrect, the file actually sits in .../119-Stokesley-Council/public/perch/index.php, but Mamp is generating or looking for .../119-Stokesley-Council/public/index.php. This is basically the problem and why my site is not working

Drew McLellan

Drew McLellan 2638 points
Perch Support

Try this:

    # Perch Runway
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/perch
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* /perch/core/runway/start.php [L]

from the docs here: https://docs.grabaperch.com/runway/getting-started/installing/rewrites/

Thanks, but no it doesn't work.

I thought RewriteCond %{REQUEST_FILENAME} !-d was only if your upgrading from an old version of perch? This is a totally fresh install.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What paths do you have set in your config.php?

Did installation all go smoothly?

Hi,

Path is define('PERCH_SITEPATH', '/Users/Grant/Sites/119-Stokesley-Council/public');

No problems on install, in fact, there is three other runway sites running perfectly fine. This only seems to be an issue with new installs?

Drew McLellan

Drew McLellan 2638 points
Perch Support

How about PERCH_LOGINPATH ?

Can you show me everything bar license keys and passwords?

config.php

<?php
    switch($_SERVER['SERVER_NAME']) {

        case 'dev.stokesleytowncouncil.gov.uk':
            include(__DIR__.'/config.dev-stokesleytowncouncil-gov-uk.php');
            break;

        default:
            include('config.production.php');
            break;
    }

    define('PERCH_LICENSE_KEY', 'XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX');
    define('PERCH_EMAIL_FROM', 'grant@XXXXXX.co.uk');
    define('PERCH_EMAIL_FROM_NAME', 'Grant Smith');

    define('PERCH_LOGINPATH', '/perch');
    define('PERCH_PATH', str_replace(DIRECTORY_SEPARATOR.'config', '', __DIR__));
    define('PERCH_CORE', PERCH_PATH.DIRECTORY_SEPARATOR.'core');

    define('PERCH_RESFILEPATH', PERCH_PATH . DIRECTORY_SEPARATOR . 'resources');
    define('PERCH_RESPATH', PERCH_LOGINPATH . '/resources');

    define('PERCH_HTML5', true);
    define('PERCH_TZ', 'UTC');

config.dev

<?php

    define('PERCH_SITEPATH', '/Users/Grant/Sites/119-Stokesley-Council/public');

    define('PERCH_SCHEDULE_SECRET', 'XXXXXXXXXXXXXX');

    define('PERCH_DB_USERNAME', 'root');
    define('PERCH_DB_PASSWORD', 'root');
    define('PERCH_DB_SERVER',   "localhost");
    define('PERCH_DB_DATABASE', 'XXXXXX');
    define('PERCH_DB_PREFIX',   'ghted4_');

Appreciate your persistance

case 'dev.stokesleytowncouncil.gov.uk':

Just checking, In mamp is your host name dev.stokesleytowncouncil.gov.uk? Otherwise Perch will default to the config.production.php.

@wayne

Yes, that's correct.

Exactly the same as the three working sites I mentioned previously.

Sorry, that was my only suggestion.

Hope you get it sorted.

Thanks for trying Wayne, it's very odd and frustrating, if none were working I'd understand.

Are there any differences between the permissions for this site and the others? Click the people icon to the right of Document Root under the General tab in MAMP to see these.

Hi Clive,

Yes, they are different! Progress, maybe?

The working site has these:

Working

Not working

Not working

In case images do not work

Working: Owner: Grant - Group: Multiple groups - Directory rights: Owner: tick tick tick Group: dash dash dash Others: dash nothing dash

Not working: Owner: Grant - Group: Admin - Directory rights: Owner: tick tick tick Group: tick tick tick Others: tick nothing tick

I tried 'Store selected server setting from current server' on the working site. Thinking I could apply it to the non-working site. This doesn't seem possible for some reason?

I also cannot see which groups are selected on the working, I know there are multiple selected, but which ones? And what options do they have applied?

I think Multiple may mean "Any of these". The only thing I can suggest is make the problem site settings the same as your other sites as far as you can.

Hi All,

Thank you, everyone, that has tried helping me with this. Unfortunately, I am no further forward, and desperately need to get on with work. I may try uninstalled Mamp pro completely, including prefs. However, if that doesn't work, I'm stuffed. This raises the question. As a Mac user, do I have any alternatives?

Suggestions welcome please