We collect development environment sites on the Mac
I would like to give a small tip to the makovods, how to establish an environment for local development of sites. This example installs the Apache + PHP + MySQL + phpMyAdmin suite from MacPorts . I’ll say right away that I’m not a detailed and debugged installation guide, and something might not work out for someone, so I’ll make a link to ready-made and tested solutions - the MAMP product and the installation guidereferenced by php.net. The environment in which the installation was performed: Mac Mini, OS X 10.4. So, we put the development environment on the Mac:
Install Apache. Enter in the terminal: sudo port install apache2 The password that will be asked is your Mac password Initially, I wanted to install Apache 1.3, but I couldn’t connect it to php5 right away, so I put the second one. Run: sudo / opt / local / apache2 / bin / apachectl start Check: we look in the localhost browser
Install PHP with MySQL support: sudo port install php5 + mysql5 sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini
Add PHP module to Apache sudo / opt / local / apache2 / bin / apxs -a -e -n "php5" /opt/local/apache2/modules/libphp5.so Insert the contents of /apache2/conf/extras-conf/mod_php.conf into /apache2/conf/httpd.conf in pens or in the same httpd.conf. Add index.php to index files. Restart Apache: sudo / opt / local / apache2 / bin / apachectl restart Verification: create test.php in / opt / local / apache2 / htdocs / with the content <? Php phpinfo ()?> And check it at localhost / test.php
Install MySQL: sudo port install mysql5 + server We give rights to the user mysql on / opt / local / var / db / and attachments to it. I did it through the Finder, probably also through the terminal. Install the database: sudo / opt / local / bin / mysql_install_db5 -user root Run the demon: sudo / opt / local / libexec / mysqld -u root
Install phpmyadmin: sudo port install phpmyadmin Go to localhost / pma / setup / index.php Installing a new localhost server without a password Log in to phpmyadmin as root
Unfortunately, the automatic launch of MySQL and Apache, as it was promised by MacPorts, did not work for me, so I launch it with pens: $ sudo / opt / local / apache2 / bin / apachectl start $ sudo / opt / local / libexec / mysqld -u root This problem with MacPorts was already described on Habré and some solutions were found.