Installing Magento on Mac OS X Server 10.4.9
This is an old revision of the document!
Here’s a basic outline of how to install Magento on Mac OS X Server 10.4.9 for development and testing purposes. The OS X Server installation I used was fairly standard, running on a local machine used for development testing.
I would think that the majority of these instructions should work with a standard install of OS X (not server), but I have yet to try this.
The following instructions assume you have MySQL running on your development server, and that you have created an empty database for the Magento install.
The default install of OS X Server 10.4 comes with PHP 4 installed, you will need to upgrade this to PHP 5. I used the package made available by Marc Liyanage on his site. Get it here: http://www.entropy.ch/software/macosx/php/
1. Follow the instructions on this site to install. There are no specific instructions for OS X Server, but the main thing to do before installing is to make sure you have disabled the PHP 4 module in Apache using the Server Admin program. Open the program and head to the web service > settings > modules. Un check ‘php4_module’, save, then stop and start the web service. You can then run the PHP 5 Install package.
2. Open /Library/WebServer/Documents/info.php and uncomment line 5, then save the file. This will give you a phpinfo file you can use to see what version of PHP you are running. Browse to http://localhost/info.php and you should see that you have PHP Version 5.2.4 installed (or a later version if the package has been updated).
3. Now you need to make a small change to the php.ini file in line with the comments here: http://www.entropy.ch/phpbb2/viewtopic.php?p=9499#9499
What’s helpful at this point is to update your locate database so you can easily find files for editing. Simply run the following command in a terminal window to do this, it may take a short time to complete. Just let it run until you get the prompt back.
You should now be able to find your php.ini file by typing the following in the terminal window:
You should get a list of files containing php.ini and their paths. I use BBedit for text editing, and use the BBedit command line tool to open files using terminal.
I ran the following command:
This opened the file in BBedit. You then need to change line 810 as stated in the above link. The only alteration I made was to run a locate command to find the exact path of mysql.sock on my machine, like so:
In my case I changed line 810 to read the following, then saved the file:
mysql.default_socket = /private/var/mysql/mysql.sock
You then need to stop and start the web service in the Server Admin program to re-load the php.ini file with its change.
Next, download the Magento zip and uncompress it. Copy the ‘magento’ folder to your web server documents folder at: /Library/WebServer/Documents/
Be careful if you plan to create a folder in your web root and simply copy the files into it using the finder. There is a file called .htaccess in the folder that is uncompressed from the Magento install zip that MUST be in the folder in your web root. Files with a ‘.’ at the start are invisible in the Mac OS finder, so it is likely you will miss this file if you copy the files out of the original folder. You can use the terminal to copy the file to the correct location if you need too. Make sure you change the permissions on the files and folders mentioned on the Magento install guide page.
You now need to edit the httpd.conf file in order to get mod rewrite working correctly. This is the main area I had difficulty with, as without making this change, when you first try to run Magento you will get a file not found error when your web server looks for http://localhost/magento/install/. ‘install’ is not a physical directory, and requires mod rewrite to be working so the URL works.
Find your httpd.conf using the locate command, and open it for editing (Again I used bbedit)
Find the file you need and open it, in my case:
Find the block of code that reads:
<Directory "/"> Options FollowSymLinks AllowOverride None </Directory>
Duplicate it by copy and pasting it underneath, and edit the Directory to match the path to your Magento install. Also, change ‘AllowOverride None’ to ‘AllowOverride All’, like so:
<Directory "/Library/WebServer/Documents/magento"> Options FollowSymLinks AllowOverride All </Directory>
You will again need to stop and start the web service using the Server Admin program so these changes are loaded.
You should now be in good shape to run the Magento installation wizard. Enter the address to your Magento install, in my case: http://localhost/magento/
You will be redirected to: http://localhost/magento/install/ and the wizard should load. If you get a page/file not found error, double check your path in httpd.conf above, and make sure that the line reads: AllowOverride All
1. When following the wizard setup. I found that in the section where you specify your MySQL database, I had to use the address 127.0.0.1 instead of localhost in order to find my MySQL server.
2. I also opened the Server Admin program and went to the web service and sites tab, where i duplicate the default site running on port 80. Double click the new site (the domain comes up as ‘_copy’, then click on the ‘security’ tab. Tick ‘enable Secure Socket Layer (SSL)’. You should then be informed the port for that site has been switched to 443. Save, and stop and start the web service. This allowed me to use https for the secure connection instead of changing it to http.
3. When using the Entropy.ch PHP5 Package, you may also need to edit /usr/local/php5/lib/php.ini and set the short_open_tag option to ‘On’. This appears to be off by default.
*Some helpful stuff concerning Mac OS, how to view hidden files on mac.
Created Dec 16, 2007 by James Down.