Parse.com PHP Setup using MAMP for OSX

I recently wanted to explore developing for Parse.com using PHP. My webdev skills are quite rusty but it wasn’t too tough. I made some notes and thought I’d share them.

I used MAMP which makes the foundational setup quick and easy. Here’s the steps… 

1. Install MAMP – http://www.mamp.info/en/index.html – download, double click, not much more too it (I avoided ‘Pro’ aspects b/c I’m skeered)

2. Download Parse.com PHP Library – https://github.com/apotropaic/parse.com-php-library

3. Create parseConfig.php where the PHP library unpacks – see SETUP at:

https://github.com/apotropaic/parse.com-php-library/blob/master/README.md#setup

– Get values (app id, Master key, REST key) for your app at: https://parse.com/apps/<YOUR APP NAME>/edit#app_keys

(I didn’t have to change the PARSEURL value)

4. Copy PHP library files into MAMP

– create /Applications/MAMP/htdocs/parse

– copy PHP library files into /Applications/MAMP/htdocs/parse (OR rename the unpacked parent dir and move it to …/htdocs)

4b. Turn off Cache

– edit /Applications/MAMP/conf/php5.5.3/php.ini

– comment out the OPcache section

5. Start MAMP app and start servers – use MAMP UI

6. Go to http://localhost:8888/parse/ and select test.php

– This will run all tests, but if you don’t have push setup correct, that will fail.

– Edit test.php to select which tests to run for example…

— uncomment out line 6: include_once ‘tests/parseObjectTest.php’;

— comment out line 12: \Enhance\Core::discoverTests(‘tests/’);

(line 12 causes all tests to run)

7. Check data on Parse.com for ‘test’ objects – https://parse.com/apps/<YOUR APP NAME>/collections#class/test

Then I Created Parse.com login/signup test script. At the bottom, it fetches and displays some data from Parse.com as a test.

NOTES: I’m still new to this so I think I’m doing the session wrong – but when I didn’t pass the session id in, it created a new session upon form submission and I lost the values.

Here’s a couple example apps I found that I thought might be useful:

Todo List example w/ PHP, MySQL and jQuery:

http://tutorialzine.com/2010/03/ajax-todo-list-jquery-php-mysql-css/

Another: http://www.mytinytodo.net

I’ve since started exploring CodeIgniter and Laravel and hope to post on them soon.

Comments are closed.