Local install not working?

  • Hi

    It's been a while since I worked with Perch (not Runway), I must be missing something obvious - but I just can't see it?

    When visiting a local version of the website I'm seeing this:


    It's downloading the index file?

    - I'm working from a copy of a site from an old server, I've dragged the `public_html` folder off the server so I'm sure all the files are there

    - I've setup the database and updated the config

    - This is an old copy of Perch, so I've made sure I'm using PHP 7.3 locally (for now) as there was an issue with magic quotes being removed in PHP 7.4+

    - There are no errors in the logs

    - My `htaccess` is in the root and looks like this

    I bet it's something super simple...

    Anyone ever hit this?

    Note. Perch works locally if I install a brand new website, I've looked at the fresh install and compared it to this site and nothing obvious seems different?

  • I’ve experienced this when I’ve downloaded a site from my hosting to a local build. The cause was additional code in the htaccess, but looking at yours, I don’t think it’s that.

    Is there any difference in the htaccess to a freshly installed one?

  • Hey thanks, that nudged me in the right direction

    Installing a fresh copy of Perch doesn't create a htaccess file for you, so I had to go deep into the archives and find another site I made with a basic htacess file, replaced it with this and cleared the cache.

    1. <IfModule mod_rewrite.c>
    2. RewriteEngine on
    3. # # Redirect to PHP if it exists.
    4. # e.g. example.com/foo will display the contents of example.com/foo.php
    5. RewriteCond %{REQUEST_FILENAME} !-f
    6. RewriteCond %{REQUEST_FILENAME} !-d
    7. RewriteCond %{REQUEST_FILENAME}.php -f
    8. RewriteRule ^(.+)$ $1.php [L,QSA]
    9. </IfModule>

    Site appears to be working locally now. Phew.