Title: MAMP PHP errors
Last modified: August 30, 2016

---

# MAMP PHP errors

 *  Resolved [Dvelop IT](https://wordpress.org/support/users/dvelop-it/)
 * (@dvelop-it)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/)
 * Hi there,
 * I’ve just setup MAMP to edit a WordPress website locally (the web hosted version
   works fine)
 * Originally had error establishing database connection error – fixed that after
   reading online by adding “AddType x-mapp-php5 .php” to .htaccess file.
 * Now the only thing showing is:
 * <?php
    /** * Front to the WordPress application. This file doesn’t do anything,
   but loads * wp-blog-header.php which does and tells WordPress to load the theme.**
   [@package](https://wordpress.org/support/users/package/) WordPress */
 * /**
    * Tells WordPress to load the WordPress theme and output it. * * [@var](https://wordpress.org/support/users/var/)
   bool */ define(‘WP_USE_THEMES’, true);
 * /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__).‘/
   wp-blog-header.php’ );
 * Any idea how to fix or whats going on?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/#post-6859319)
 * If that’s showing in that format it means that you’ve done something to disable
   PHP. I’d recommend removeing what you added to the `.htaccess` file as that seems
   to be all that you did to make it happen.
 * Oh, and the database error means that PHP is running, but you have invalid database
   connection credentials in your `wp-config.php` file, so you should investigate
   that instead of doing any further changes.
 *  Thread Starter [Dvelop IT](https://wordpress.org/support/users/dvelop-it/)
 * (@dvelop-it)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/#post-6859321)
 * Thanks for your help – I have removed the .htaccess code which as you mentioned
   will show the previous database error. However the wp-config file is exactly 
   the same credentials as the version on the live hosting environment so it cant
   be an issue with the user/password details. I am not familiar with MAMP or local
   hosting environments so not sure if there is anything different I need to do 
   with linking the database? I have followed the MAMP instructions and have placed
   the .sql file in ../db/mysql/
 * Anything I’m missing?
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/#post-6859323)
 * > However the wp-config file is exactly the same credentials as the version on
   > the live hosting environment so it cant be an issue with the user/password 
   > details
 * That’s most likely the problem. Does your host allow remote access to the database
   server? some do, but most don’t, and if yours doesn’t you will get that error
   message from any machine outside of the actual hosting server.
 * Also, you will need to copy the database anyway. With WordPress, the URL’s used
   around the site are stored around the database, so you will need to set those
   to your local environment before you’ll be able to do anything locally.
 *  Thread Starter [Dvelop IT](https://wordpress.org/support/users/dvelop-it/)
 * (@dvelop-it)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/#post-6859324)
 * Hi I have simply copied the database file to the directory specified in MAMP ../
   db/mysql
 * how do I go about modifying the paths to get the wordpress install ‘talking’ 
   to the database in its new location. (sorry first time trying to install locally
   so its quite different for me) Thanks so much for your help.
 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/#post-6859327)
 * Copying raw database files doesn’t normally work successfully. Most times you’d
   want to use something like phpMyAdmin to export and import the database between
   systems.
 *  Thread Starter [Dvelop IT](https://wordpress.org/support/users/dvelop-it/)
 * (@dvelop-it)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/#post-6859352)
 * Thanks for your help – got it sorted by importing through phpMyAdmin. Cheers.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘MAMP PHP errors’ is closed to new replies.

## Tags

 * [installation](https://wordpress.org/support/topic-tag/installation/)
 * [MAMP](https://wordpress.org/support/topic-tag/mamp/)

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 6 replies
 * 2 participants
 * Last reply from: [Dvelop IT](https://wordpress.org/support/users/dvelop-it/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/mamp-php-errors/#post-6859352)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
