📜 ⬆️ ⬇️

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 guide referenced 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:
  1. Install MacPorts .
  2. 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
  3. Install PHP with MySQL support:
    sudo port install php5 + mysql5
    sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini
  4. 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
  5. 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
  6. 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.

')

Source: https://habr.com/ru/post/58289/


All Articles