
Putting the development environment of sites on the Mac
I would like to give a little tip to the macoworkers how to set up an environment for local site development. This example examines installing Apache + PHP + MySQL + phpMyAdmin from MacPorts . I must say that I have this topic is not a detailed and well-functioning installation guide and someone that something can go wrong, so I will refer to ready-made and proven solutions - product MAMP and Installation Guide , to which refers php.net.
Installation Environment: Mac Mini, OS X 10.4.
So, put the development environment on the Mac:
Unfortunately, MySQL and Apache didn’t start automatically, as MacPorts promised, it didn’t work for me, so I run it with the handles:
$ sudo / opt / local / apache2 / bin / apachectl start
$ sudo / opt / local / libexec / mysqld -u root
This problem is MacPorts was already described on Habré and any solutions were found.
Installation Environment: Mac Mini, OS X 10.4.
So, put the development environment on the Mac:
- Install MacPorts .
- Install Apache.
We enter in the terminal:
sudo port install apache2 The
password that is asked is your Mac password.
Initially, I wanted to install Apache 1.3, but I couldn’t connect it with php5 on the move, so I installed the second one.
We start:
sudo / opt / local / apache2 / bin / apachectl start
Check: we look in the localhost browser - Installing PHP with MySQL support:
sudo port install php5 + mysql5
sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini - Add the 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 in /apache2/conf/httpd.conf with pens or inclusions in the same httpd.conf.
Add index.php to the index files.
We restart apache:
sudo / opt / local / apache2 / bin / apachectl restart
Verification: create test.php in / opt / local / apache2 / htdocs / with the contents and check it at localhost / test.php - Install MySQL:
sudo port install mysql5 + server
Grant rights to the mysql user on / opt / local / var / db / and attachments to it. I did it through Finder, probably it is also possible through the terminal.
Install the database:
sudo / opt / local / bin / mysql_install_db5 -user root
Run the daemon:
sudo / opt / local / libexec / mysqld -u root - Install phpmyadmin:
sudo port install phpmyadmin
Go to localhost / pma / setup / index.php
Install a new localhost server without password
Go to phpmyadmin as root
Unfortunately, MySQL and Apache didn’t start automatically, as MacPorts promised, it didn’t work for me, so I run it with the handles:
$ sudo / opt / local / apache2 / bin / apachectl start
$ sudo / opt / local / libexec / mysqld -u root
This problem is MacPorts was already described on Habré and any solutions were found.