A quick easy way to create PHP development environment on MAC.
The inspiration to create this was a direct result from my post Setting up PHP7 Development Evironment on MAC in which I was detailing the steps to setting up a PHP development environment on my mac. There was so much twiddling with configuration files etc. I just wanted an easier way, and being a software engineer I had the power to make it easy, so I did!
Currnently POMAMA is configured to run only with PHP7 due in part that is what I primarily develop in at the moment.
Typically I install PHP on my mac using HomeBrew. If you don't currently use HomeBrew . Why? Install HomeBrew on Mac
The create script automatically install Homwbrew if it is not already installed and it will also install PHP 7
To install PHP via HomeBrew is quick and easy.
$ brew tap homebrew/dupes $ brew tap homebrew/versions $ brew tap homebrew/homebrew-php $ brew install php70 $ brew install php70-intl
dnsmasq provides network infrastructure for small networks. It used within POMAMA to create friendly URLs for project folders. i.e. http://threenine.dev
The create script will automatically install dnsmasq
Install dnsmasq via HomeBrew and configure it
$ brew install dnsmasq $ cd $(brew --prefix) $ mkdir etc $ echo 'address=/.dev/127.0.0.1' > etc/dnsmasq.conf $ sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons $ sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist $ sudo mkdir /etc/resolver $ sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'
Currently POMAMA only support mySQL
$ brew install mysql # Start the mysql server $ brew services start mysql # Secure your mySQL Installation $ mysql_secure_installation
Simply copy 3 files to your home a.k.a root directory :
..*create.sh ..*apache2 ..*home
Open a terminal window and execute
$ bash create.sh
The shell will prompt for a Directory name:
Directory Name Can be anything you like, however we recommend calling Sites
You may be prompted to enter your Password for sudo access. This is to copy the ammended apache2 configuration files over.
Once create has completed simply navigate to http://localhost , your new Development Home Page will be visible in all it's glory. You are now ready to start creating new PHP projects
To create new PHP projects
To create a new project simply navigate to your chosen directory i.e. Sites, and open the projects directory , create a new folder with the name of your new project i.e. fancynewproject
Add your new php files ensuring you add a new index.php
You can then just navigate in your browser to http://fancynewproject.dev your new site will be displayed.
If you have a few ideas for the product and would like to contribute just let us know