If you’re a web developer and your development machine is a Mac you have likely discovered that “Web Sharing” was removed from OSX Mountain Lion.
There are a few tutorials on the web that can walk you through getting a PHP stack set up on the Mac, but they all describe somewhat more work than necessary.
Since Zend Server free edition offers production quality features and has installers for Linux, Windows and Mac – it makes a fine choice to replace the missing OSX Web Sharing feature, and it is easy to install.
Start by visiting the Zend downloads page and selecting the Zend Server download option.
When you click on the Zend Server download button you will be taken to another page where you will have the option to choose the platform and the PHP version of theZend Server that you want to download.
Since I’m working on a Mac, the “Mac OS X” tab is automatically selected.
After downloading the .dmg file for the PHP version that I choose I click on the .dmg file and see the Zend Server 6 installer.
The installer will check to make sure your operating system instance can supportZend Server.
Click “Continue” to go!
… and again !
STOP…. Read the installation information, there is some useful info in there.
The installer will make one last check to make sure that you have enough disk space to install Zend Server.
Click “Install.
Enter your password to confirm to OSX that the installer is authorized to install Zend Server.
You will get an ongoing status of the install process.
The installer tells you when it’s done. I can’t guess how many times I’ve run the installer but I’ve never had this part fail.
Next, there are two little modifications that I make before I start the server for the first time.
Because you may install Zend Server on a machine that already has a web server,Zend Server installs by default listening to port 10088.
Zend Server is my default web server on all my servers and development machines, and as we know OSX Mountain Lion no longer includes a default web server, so I want to configure my Zend Server instance to listen on port 80 (the HTTP default port).
To do this, start by opening a finder instance. We’ll be editing the http.conf file which lives in a system directory so you it won’t be visible in the finder. If you open Finder and click to navigate to your hard disk, you wont see a folder named “usr”.
No problem! Press Shift + ⌘ (Command) + G
This will open the Finder “goto” dialog where you can enter the path to any folder that you please, even if it’s not visible.
We want /usr/local/Zend
Note the “apache2″ folder, click to enter it.
Find the http.conf file, this is the one that we need to edit.
NOTE: This file is probably NOT, by default, writable by you.
Some editors are smart enough to ask you to authenticate when you try to save a modified file for which you do not have write permissions. If your editort does not do this you will need to “Control->Click”, choose “Get Info” and give yourself write permissions.
Once you have opened http.conf, search for the “Listen” attribute.
Note, by default the configuration is set to listen on port 10088, you can either change 10088 to just 80, or you can add another “Listen” line like this…
“Listen 80″
Save the file and the Apache2 instance of Zend Server will now listen on port 80.
The next little tweak I like to make is to fix a little PHP nuance which is that, by default, the php.ini doesn’t specify a default time zone.
This will often cause pesky warning messages.
There is a way to correct this inside Zend Server but I find it easier to fix the issue before starting Zend Server for the first time.
Navigate back up to /usr/zend and enter the “etc” folder.
Find the Zend Server instance “php.ini” file.
… and open it in a text editor.
Then search for “date.timezone“. When you find it you will notice that it is commented out and there is no default specified.
We need to uncomment the date.timezone setting and specify an actual time zone.
Once you have done this, save the file and we are ready to log in to Zend Server 6 for the first time.
Point your browser at the Zend Server Console at http://localhost:10081/ZendServer/
Of course, if you installed Zend Server on a server other than your local machine you will change localhost to whatever name you use to resolve to your server.
Port 10081 is the default.
Agree to the license and click “Next”.
Since we’re setting up a development machine we’re going to select “Development” as the launch option. If you were configuring a production (or Q&A or Staging server) you might might go the other way.
Click “Next”
Enter an admin password and, optionally, add a developer password.
The “admin” and “developer” accounts have different permissions. Perhaps not an issue on a local development box but a very cool feature in a production environment because a developer account can be given “read only” access to specific apps so that you can trace and debug tough to reproduce bugs without messing up the production environment.
Of course, in more advanced scenarios you can coordinate permissions with yourLDAP identities.
Last chance ! Did you write down those passwords somewhere ?
Click “Next”.
Since we just installed Zend Server there is no web app configured yet. You may want to install the sample application so that you can explore all the features of Zend Server!
To do that, click on the “Welcome” Tab.
Then you can click the “Install Demo” button.
After the demo application is installed the server will need a restart. If it doesn’t auto restart, just click on the restart icon (3rd from the right) to restart Zend Server.
After restarting, the ZendDemoApp is pre-populated with a collection of “production data”.
Take a look at the “Notification Icon” that has an orange circle with the number “1″ in it.
When you install Zend Server 6 you have the full product feature set for 7 days. (Things like unlimited history log, Java Bridge, Job Queue, etc)
I installed Zend Server on my machine five days ago so when I click on the notification icon I’m advised that my license will expire in 2 days.
I can delay the message (to remind me later) or I can click on the “Details” button to take action.
On the license details page I have three options.
- Enter a license that I purchased from Zend
- Extend the trial period for a total of 30 days
- Get a free license and turn off the high end features.
What’s the difference you ask ?
From the Zend Server Product page…..
Free Versus Paid?
While free Zend Server is a great solution for a development project, it has limitations compared to paid Zend Server subscription. Paid subscriptions include longer data retention (months or years rather than an hour of metrics), technical support and security patches , more performance features, and multi-server support and management.
Note that if you choose the free version, once a year you will be asked to “renew” just so we can keep track of how many people are using it.
Now you’re ready to do your development on you Mac with the exact same stack that can provide you with enterprise quality in production.