3
Articles of php tutorial magento tutorial from php community Installing Magento on Mac OS X Server 2011-01-05 09:01:20 admin 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. Install PHP5 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. sudo /usr/libexec/locate.updatedb You should now be able to find your php.ini file by typing the following in the terminal window: locate php.ini 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: bbedit /usr/local/php5/lib/php.ini 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: locate mysql.sock

Installing magento on mac os x server

Embed Size (px)

Citation preview

Page 1: Installing magento on mac os x server

Articles of php tutorial magento tutorial from phpcommunity

Installing Magento on Mac OS X Server2011-01-05 09:01:20 admin

Here’s a basic outline of how to install Magento on Mac OS X Server 10.4.9 for development and testingpurposes. The OS X Server installation I used was fairly standard, running on a local machine used fordevelopment testing.

I would think that the majority of these instructions should work with a standard install of OS X (notserver), but I have yet to try this.

The following instructions assume you have MySQL running on your development server, and that youhave created an empty database for the Magento install.

Install PHP5

The default install of OS X Server 10.4 comes with PHP 4 installed, you will need to upgrade thisto PHP 5. I used the package made available by Marc Liyanage on his site. Get ithere: 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 themain thing to do before installing is to make sure you have disabled the PHP 4 module in Apache usingthe Server Admin program. Open the program and head to the web service > settings > modules. Uncheck ‘php4_module’, save, then stop and start the web service. You can then run the PHP 5 Installpackage.

2. Open /Library/WebServer/Documents/info.php and uncomment line 5, then save the file. This will giveyou a phpinfo file you can use to see what version of PHP you are running. Browseto http://localhost/info.php and you should see that you havePHP Version 5.2.4 installed (or a laterversion if the package has been updated).

3. Now you need to make a small change to the php.ini file in line with the commentshere: 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. Simplyrun the following command in a terminal window to do this, it may take a short time to complete. Just let itrun until you get the prompt back.

sudo /usr/libexec/locate.updatedb

You should now be able to find your php.ini file by typing the following in the terminal window:

locate php.ini

You should get a list of files containing php.ini and their paths. I use BBedit for text editing, and use theBBedit command line tool to open files using terminal.

I ran the following command:

bbedit /usr/local/php5/lib/php.ini

This opened the file in BBedit. You then need to change line 810 as stated in the above link. The onlyalteration I made was to run a locate command to find the exact path of mysql.sock on my machine, likeso:

locate mysql.sock

Page 2: Installing magento on mac os x server

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 filewith its change.

Download Magento

Next, download the Magento zip and uncompress it. Copy the ‘magento’ folder to your web serverdocuments 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 MUSTbe in the folder in your web root. Files with a ‘.’ at the start are invisible in the Mac OS finder, so it is likelyyou will miss this file if you copy the files out of the original folder. You can use the terminal to copy the fileto the correct location if you need too. Make sure you change the permissions on the files and foldersmentioned on the Magento install guide page.

Getting Mod Rewrite Working

You now need to edit the httpd.conf file in order to get mod rewrite working correctly. This is the main areaI had difficulty with, as without making this change, when you first try to run Magento you will get a file notfound error when your web server looks for http://localhost/magento/install/. ‘install’ is not a physicaldirectory, and requires mod rewrite to be working so the URLworks.

Find your httpd.conf using the locate command, and open it for editing (Again I used bbedit)

locate httpd.conf

Find the file you need and open it, in my case:

bbedit /private/etc/httpd/httpd.conf

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 Magentoinstall. 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 changesare loaded.

Running The Install Wizard

You should now be in good shape to run the Magento installation wizard. Enter the address to yourMagento install, in my case: http://localhost/magento/

You will be redirected to: http://localhost/magento/install/ and the wizard should load. If you get apage/file not found error, double check your path in httpd.conf above, and make sure that the line reads:

Page 3: Installing magento on mac os x server

Tweet

AllowOverride All

Notes

1. When following the wizard setup. I found that in the section where you specify your MySQL database, Ihad 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 duplicatethe default site running on port 80. Double click the new site (the domain comes up as ‘_copy’, then clickon the ‘security’ tab. Tick ‘enable Secure Socket Layer (SSL)’. You should then be informed the port forthat site has been switched to 443. Save, and stop and start the web service. This allowed me to usehttps 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 setthe short_open_tag option to ‘On’. This appears to be off by default.

relative link:http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/installing-magento-on-mac-os-x-server-10-4-9

People who read this post also read:

Moving Magento To Another Serverhow to install magento on window