Using Mamp With Wordpress

broken image


When you want to design or develop a dynamic WordPress website offline where no one but you can see it, then the FREE version of MAMP is the way to go.

I have just downloaded Mamp and WordPress to my Macos X and I would like to be able to create and store some WordPress sites on this host. I have encountered a problem connecting to WordPress login page. I think it's something to do with my Apache. I have really tried everything, this is very frustrating. Whenever I try to put in the localhost. With some careful folder organization, you can host as many WordPress sites as you want on your computer using MAMP. Learn how in this video. 5) Move the WordPress Files to MAMP's htdocs Folder Copy the downloaded 'wordpress' folder by right-clicking on the folder then selecting 'Copy wordpress'. Note: The downloaded file may be zipped (compressed) depending on which browser (and its settings) you used to download, so you may have to double-click on the file to unzip its contents. In this course, I'll show you how to do just that: install and run WordPress on your Mac using the popular MAMP and MAMP PRO applications. Installing and running WordPress on your local computer is essential, whether you're learning how to use WordPress or you want to develop themes or plugins or entire sites. I installed WordPress on my Mac Pro using MAMP and following all instructions to the letter. Immediately after installing, I was able to access the WP dashboard and install a theme. I logged out and quit MAMP. Now I am not able to access the dashboard.

What is MAMP ?

MAMP stands for Macintosh, Apache, MySQL, and PHP. MAMP is an application you can install on your Mac that gives you all of the tools needed to run WordPress on your local machine, making it much easier for development and testing websites before making them live.

Step 1: Download and Install MAMP on your Mac (Windows version still in development).

Visit the MAMP website to download the FREE version of MAMP. Install it just as you would any other Mac Application.

Step 2: Basic MAMP Settings

Using Mamp With Wordpress

Now that you've got MAMP installed on your computer, launch MAMP application. While you're editing settings, MAMP might prompt you for an administrator password. Once you open MAMP, follow these steps:

  • Click the PREFERENCES button and then 'Ports' (along the top). For ease of use, leave the default ports of 8888 for Apache, and 8889 for MySQL. Your local URL will then be localhost:8888.
  • On the PHP tab, verify that version 5 is selected.
  • On the APACHE tab, set a document root. This is where all of your files are going to be for your local web server. An example of a document root is /Users/USERNAME/Sites/ (the default location for this is /Applications/MAMP/htdocs/).

Once you're done editing all of the settings, hit OK to save them.

Step 3: Starting MAMP Servers

To start the MAMP Apache and MySQL servers, simply click 'Start Servers' from the MAMP start-up screen. Your MAMP servers have now been started! Once the MAMP servers start, the MAMP start page should open in your default web browser. (If it did not open. just click on 'Open start page' in the MAMP window.)

Step 4: Creating The Database

From the MAMP start page is open in your browser, click the phpMyAdmin link from the MySQL section.

In the center, enter in a database name such as 'db_mysite', leave the default of 'collation' and press 'create'. (If this is not your first database, click on the word 'NEW' in the left column to bring up the 'create new database' line.)

Step 5: Downloading WordPress

Download and install the latest version of WordPress. Unzip the file you just downloaded, which will create the folder named 'wordpress' (you can rename this to whatever you want – I use the name of my current site – let's call it 'mysite'). Drag this folder into the MAMP document root from Step 2 above – /Users/USERNAME/Sites/ (or the default location for this is /Applications/MAMP/htdocs/ if you used the default location).

Step 6: Installing WordPress

In your web browser, go to localhost:8888/mysite. You may get a screen that says 'There doesn't seem to be a wp-config.php file. I need this before we can get started.' THAT'S OK! Just click 'Create a configuration file' and then click 'Let's Go' from the next screen. Enter the following information for the database:

Using Mamp With Wordpress Website

Database Name: db_mysite (the database name from Step 3 above)
User Name (database): root
Password (database): root
Database Host/server: localhost
Table Prefix: wp_

Once this is entered and you continue, you'll receive a message that says 'All right, sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…'.

Click to 'Run the Install' to continue onto WordPress' famous 5-minute install. Complete by entering a blog name and email address, and you're ready to use WordPress on your Mac!

Typically when I build out a new site, I do it on a real server hosted off-premises. I started building sites that way a long time ago, and it just stuck. Why? Out of convenience in showing the client, and probably because it was easier for me to push them live (back then, circa 2013). Now in 2021, much has changed. While I have a cloud server dedicated for new builds and development work, I decided I'd try development for this next new project locally on my Mac, using MAMP.

I've had MAMP PRO for a while, but never got the hang of it. But as I typically do, I persisted through and learned how it works. This new project is using a MAMP PRO with a hostname, https, Nginx, and MySQL 5 (because my version of MAMP does support MySQL 8 and I need to pay to update). I still can run Grunt on my Mac from terminal and do things pretty much the same as if I was developing on a cloud server like AWS Lightsail.

Post-Processing of Image Failed

Today I ran into the image roadblock that WordPress provided. An error message that states:

Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.

And looks something like this:

Yea, my file was a few pixels bigger than the recommended 2500px (2560px wide to be exact). And it clocked in at 1.3 MB which is big for serving up on web, but not that big if you're going to use an image optimization tool like EWWW.IO.

I started searching on Google and did everything everyone said to try, even though some of them didn't seem to make sense:

  • Increase php max_upload_size
  • Increase php post_max_size
  • Increase php memory_limit
  • Increase php max_execution_time
  • Increase php max_input_time
  • Increase WP_MAX_MEMORY_LIMIT
  • Disable the 'big image size threshold': add_filter( ‘big_image_size_threshold', ‘__return_false' ); — I thought this would surely do it, but it didn't fix the problem
  • Change PHP versions

But the one thing I didn't do was the one thing I needed to do:

Using mamp with wordpress free

Now that you've got MAMP installed on your computer, launch MAMP application. While you're editing settings, MAMP might prompt you for an administrator password. Once you open MAMP, follow these steps:

  • Click the PREFERENCES button and then 'Ports' (along the top). For ease of use, leave the default ports of 8888 for Apache, and 8889 for MySQL. Your local URL will then be localhost:8888.
  • On the PHP tab, verify that version 5 is selected.
  • On the APACHE tab, set a document root. This is where all of your files are going to be for your local web server. An example of a document root is /Users/USERNAME/Sites/ (the default location for this is /Applications/MAMP/htdocs/).

Once you're done editing all of the settings, hit OK to save them.

Step 3: Starting MAMP Servers

To start the MAMP Apache and MySQL servers, simply click 'Start Servers' from the MAMP start-up screen. Your MAMP servers have now been started! Once the MAMP servers start, the MAMP start page should open in your default web browser. (If it did not open. just click on 'Open start page' in the MAMP window.)

Step 4: Creating The Database

From the MAMP start page is open in your browser, click the phpMyAdmin link from the MySQL section.

In the center, enter in a database name such as 'db_mysite', leave the default of 'collation' and press 'create'. (If this is not your first database, click on the word 'NEW' in the left column to bring up the 'create new database' line.)

Step 5: Downloading WordPress

Download and install the latest version of WordPress. Unzip the file you just downloaded, which will create the folder named 'wordpress' (you can rename this to whatever you want – I use the name of my current site – let's call it 'mysite'). Drag this folder into the MAMP document root from Step 2 above – /Users/USERNAME/Sites/ (or the default location for this is /Applications/MAMP/htdocs/ if you used the default location).

Step 6: Installing WordPress

In your web browser, go to localhost:8888/mysite. You may get a screen that says 'There doesn't seem to be a wp-config.php file. I need this before we can get started.' THAT'S OK! Just click 'Create a configuration file' and then click 'Let's Go' from the next screen. Enter the following information for the database:

Using Mamp With Wordpress Website

Database Name: db_mysite (the database name from Step 3 above)
User Name (database): root
Password (database): root
Database Host/server: localhost
Table Prefix: wp_

Once this is entered and you continue, you'll receive a message that says 'All right, sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…'.

Click to 'Run the Install' to continue onto WordPress' famous 5-minute install. Complete by entering a blog name and email address, and you're ready to use WordPress on your Mac!

Typically when I build out a new site, I do it on a real server hosted off-premises. I started building sites that way a long time ago, and it just stuck. Why? Out of convenience in showing the client, and probably because it was easier for me to push them live (back then, circa 2013). Now in 2021, much has changed. While I have a cloud server dedicated for new builds and development work, I decided I'd try development for this next new project locally on my Mac, using MAMP.

I've had MAMP PRO for a while, but never got the hang of it. But as I typically do, I persisted through and learned how it works. This new project is using a MAMP PRO with a hostname, https, Nginx, and MySQL 5 (because my version of MAMP does support MySQL 8 and I need to pay to update). I still can run Grunt on my Mac from terminal and do things pretty much the same as if I was developing on a cloud server like AWS Lightsail.

Post-Processing of Image Failed

Today I ran into the image roadblock that WordPress provided. An error message that states:

Post-processing of the image failed likely because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.

And looks something like this:

Yea, my file was a few pixels bigger than the recommended 2500px (2560px wide to be exact). And it clocked in at 1.3 MB which is big for serving up on web, but not that big if you're going to use an image optimization tool like EWWW.IO.

I started searching on Google and did everything everyone said to try, even though some of them didn't seem to make sense:

  • Increase php max_upload_size
  • Increase php post_max_size
  • Increase php memory_limit
  • Increase php max_execution_time
  • Increase php max_input_time
  • Increase WP_MAX_MEMORY_LIMIT
  • Disable the 'big image size threshold': add_filter( ‘big_image_size_threshold', ‘__return_false' ); — I thought this would surely do it, but it didn't fix the problem
  • Change PHP versions

But the one thing I didn't do was the one thing I needed to do:

Increase NGINX client_max_body_size !!!!!!!!!!!!!

By default, in MAMP PRO, this is set to something like 1MB. It's not even noted in the nginx.conf file.

In MAMP PRO, the global nginx settings (and PHP, etc) are located by going to File > Edit Template.

Open up the Nginx template, and go to around line 18. Add another line with the following setting:

You can set the value to whatever you want. You probably only need 5M or 10M. Microsoft remote desktop raspberry pi linux. Most images bigger than that are just way too big as a starting point.

Save the template (I do a Command-S) but I think closing the editor will save it as well. Make sure your Nginx service restarts. then try uploading again.

It works!

The Nginx layer comes before PHP so that's why the error appeared so quickly after trying to upload, and that's why it failed. Make Nginx happy, and your troubles go away.

Using Mamp With Wordpress Login

Satisfaction in Solving the Problem

You could say, 'Nic, why not just knock down the image size in Photoshop first. You would have been done an hour ago.' And you would be right. I would have been done with my image uploads for this project.

Installing Wordpress On Mamp

But problems like this eat at my soul. They have to be explicable. And they usually are. It just comes down to how much patience you have. And how much you're willing to get things right.

Mamp For Windows

I figure there are more people like me out there who want to solve problems like these, and search the Internet for solutions. I genuinely hope I was able to help another soul get past such a silly default setting.

Happy Image Uploading!





broken image