Hi I have downloaded my live site and want to run it locally through Mamp so that I can do an upgrade from 3.7.29 to the new craft 4. I have run craft cms locally before so I know it does work however that is usually from a fresh installation. I have the database and all files installed and I have done the usual configuration in Mamp. I have set .env to look for the local database rather than the live site and use host PRIMARY_SITE_URL=http://localhost:8888 rather than the live host. In general.php I have site url as: 'siteUrl' => 'http://localhost:8888/' rather than the live url.
When I test out to see the home page in a browser I just get a blank screen (no error) with a file download with a different name on the file each time such as 3J5BZQ7Y and when I open that file in note pad it shows these settings:
<?php
/**
* Craft web bootstrap file
*/
// Define path constants
define('CRAFT_BASE_PATH', dirname(__DIR__));
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH . '/vendor');
// Load Composer's autoloader
require_once CRAFT_VENDOR_PATH . '/autoload.php';
// Load dotenv?
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH . '/.env')) {
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
}
// Define additional PHP constants
// (see https://craftcms.com/docs/3.x/config/#php-constants)
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
// ...
// Load and run Craft
/** @var craft\web\Application $app */
$app = require CRAFT_VENDOR_PATH . '/craftcms/cms/bootstrap/web.php';
$app->run();
I have tried out different php versions through Mamp to see if it could be that (everything from 5.xx upto 8.08) but still just the same downlaod file. I have also checked in terminal whether php is actually installed with php -v and it says
PHP 8.0.8 (cli) (built: Sep 30 2021 13:54:04) ( NTS )
It says this regardless of which version I choose in Mamp.
Does anyone know what I could be doing wrong please? Thanks