How to solve the blank page issue with MAMP PRO and Drupal

I have recently upgraded to MAMP PRO 2 and to my surprise some of the sites I was working with started showing a blank page locally even though the online version is working fine. After spending some hours in research, I have found the solution. It was basically because of the PHP memory limit.

If you add the following code in your index.php file , it will show the error OR  you could open MAMP PRO >>log>>Apache and check the logs. I got the following error

Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /Applications/MAMP/htdocs/testsite/sites/all/modules/views/plugins/views_plugin_display.inc on line 843

You can solve the problem by doing the following steps

  1. Start MAMP PRO
  2. Stop the server if it’s running
  3. Goto Menu -> File -> Edit Template -> PHP5 php.ini
  4. The PHP ini file will be opened.
  5. If a dialogue box pops up, read it and confirm with OK
  6. Search (Command-F) for “memory_limit” (without quotes)
  7. You should get the following line:
    memory_limit = 8M ; Maximum amount of memory a script may consume (8M)
  8. Now you can change the default value of 8M. For instance. into 32M or even more (like 128M)
  9. Save (Command-S) your changes.
  10. Close (Command-W) the file.
  11. Start the Server.

Now you should be able to see your page. Good Luck with your Drupal development!!

How to solve the blank page issue with MAMP PRO and Drupal

Leave a Reply

Your email address will not be published. Required fields are marked *