After deploying MAMP Pro and their configuration we need to update or replace Mac’s standard PHP to make things work like you would expect on CLI and on web.
Strangely those things works very differently.
Download MAMP Pro.
Replace Mac’s default PHP
After you download the copy of MAMP.
Head to the latest PHP version in MAMP and replace with Mac’s.
My PHP directory currently is on:
/Applications/MAMP/bin/php/php5.5.14/bin
and copy all files them to:
/usr/bin
sudo cp /Applications/MAMP/bin/php/php5.5.14/bin/* /usr/bin
link MAMP Pro's generated php.ini file to /etc/
sudo ln -nsf /Library/Application Support/appsolute/MAMP PRO/conf/php.ini /etc/php.ini
You might restart your Mac.
When you check which ini file PHP is using:
php --ini
You’ll see:
Loaded Configuration File: /Applications/MAMP/bin/php/php5.5.14/conf/php.ini
So something after copying the PHP directory, the PHP check different path for php.ini
instead the path of Mac’s which is:
/etc/php.ini
Make sure in the future don’t delete MAMP or something will fail?
Install needed files
Install
- XCode
- NodeJS
- NodeJS: bower, gulp, less, uglify-js
- MacPorts
- Redis + PHPRedis
- Oracle JDK 7 + Neo4J
Download XCode from Apple App Store
Run and close XCode
Install NodeJS and their developer stuff
Download NodeJS and install
Install NodeJS developer stuff globally
sudo npm install -g bower gulp less uglify-js
Install MacPorts
Download MacPorts and choose correct OSX version, for me it's Mavericks
Let's update MacPorts just incase. Go here for more info.
Update MacPorts
sudo port selfupdate
sudo port upgrade outdated
Install Redis
sudo port install redis
To start Redis server use:
redis-server
.
To use Redis CLI use:redis-cli
Install PHP Redis
sudo port install php55-redis
Set MAMP your Default PHP to the latest version. Currently it is: 5.5.14.
You see major is 5, minor is 5. Make sure you install correct PHP Redis version which isphp55-redis
.
If you want to use different minor version other than 5.5, then you'll need replace Mac's Default PHP too, just by copy over them.
My current PHP Redis location for MAMP
/opt/local/lib/php55/extensions/no-debug-non-zts-20121212/redis.so
Install Oracle JDK 7 + Neo4J
Before installing Neo4J you’ll need to install Java (Oracle JDK 7), Apple's Java 6 will fail.
Download Neo4J Community Edition or head to this page
Setting up MAMP's php.ini for PHP Redis
First copy redis.so to MAMP Pro's PHP extension directory
cp /opt/local/lib/php55/extensions/no-debug-non-zts-20121212/redis.so /Applications/MAMP/bin/php/php5.5.14/lib/php/extensions/no-debug-non-zts-20121212/
Let's edit php.ini template file
in MAMP Pro app. MAMP Pro tend to regenerate php.ini file when you restart the server through that app.
location of the file is:
~/Library/Application Support/appsolute/MAMP PRO/templates/php5.5.14.ini.temp
Open up MAMP Pro, go to the menu
File > Edit Template > PHP > PHP 5.5.14 php.ini
to edit the file and add:
extension="/opt/local/lib/php55/extensions/no-debug-non-zts-20121212/redis.so"
Time to deploy
Head to your Apache httpdocs directory where you want to deploy your files.
I'm using Apache VHOSTS module and got things configured, so my directory deployment is:
/ var/www/vhosts/starapple.nl/subdomains/phind
/ httpdocs -> phind/web
/ phind
/ neo4j-community-1.9.6
And create a mac bash script or run this deploy.mac.sh
HTROOT=`pwd`
git clone git@bitbucket.org:starapple/phind.git
cd phind
# uses composer.phar somewhere in your $PATH
composer update
# installs from package.json
npm install
# global install
sudo npm install -g bower less uglify-js
# install from bower.json
bower install
# gems
sudo gem install sass compass zen-grids
MAMP default MySQL user and password is:
root:root
You'll need
security.yml
from the developers and put them to
phind/app/config/security.yml
You'll need
starapple_2014-09-02.sql
database data to import in your local MySQLstarapple
database
Edit AppKernel.php
Edit phind/app/AppKernel.php
//new Bc\Bundle\BootstrapBundle\BcBootstrapBundle(),
new Braincrafted\Bundle\BootstrapBundle\BraincraftedBootstrapBundle(),
When you're still on phind
directory init with this command
scripts/clearcache.sh
Check the web how it looks now. Mine is this.
Sometimes you see a styleless page. Use
gulp css
to compile.
app/console doctrine:migrations:migrate
git rm app/DoctrineMigrations/*
app/console doctrine:cache:clear-metadata
app/console doctrine:cache:clear-metadata --env=prod
app/console doctrine:migrations:diff
app/console doctrine:migrations:migrate
rm app/DoctrineMigrations/*
git checkout app/DoctrineMigrations/*
git checkout app/DoctrineMigrations
git status
# return to root
cd $HTROOT
Configuring Neo4J
You'll need data.zip
from the developers.
Go the directory where you want to deploy, mine is:
/ var/www/vhosts/starapple.nl/subdomains/phind
Download and extract file
curl -OL http://dist.neo4j.org/neo4j-community-1.9.6-unix.tar.gz
tar -xzf neo4j-community-1.9.6-unix.tar.gz
Replace the content in data.zip
with the directory:
neo4j-community-1.9.6-unix\data
Go to neo4j bin directory and start a file
./neo4j start
Check your browser http://localhost:7474/