![]() In Apache’s config file /opt/local/apache2/conf/nf, add index.php to the DirectoryIndex: $ sudo /opt/local/apache2/bin/apxs -a -e -n "php7" mod_php70.so For development purposes use: $ cd /opt/local/etc/php70įor production use: $ cd /opt/local/etc/php70Įnable the PHP module in Apache $ cd /opt/local/apache2/modules You might also need the following PHP extensions: $ sudo port install \ Last step is installing PHP: $ sudo port install php70-apache2handler If you want to use mysql on the command line, you can link mysql to MariaDB: $ sudo port select -set mysql mariadb PHP If you want to use 172.0.0.1 for your MySQL connections, you should comment out that line. Note: MacPorts MariaDB has skip-networking enabled by default in /opt/local/etc/mariadb/macports-default.cnf. You can also specify the socket path in your PHP config file: see below… If you work a lot with sockets for MySQL/MariaDB, you can create a symbolic link from the default socket path to MacPort’s path: $ sudo ln -s /opt/local/var/run/mariadb/mysqld.sock /tmp/mysql.sock Next we need to create a password for the root user, don’t forget to do this step! This procedure will interactively ask you some security details: $ /opt/local/lib/mariadb/bin/mysql_secure_installation Time to start MariaDB: $ sudo port load mariadb-server Once MariaDB is installed, we need to create the main databases: $ sudo -u _mysql /opt/local/lib/mariadb/bin/mysql_install_db Stopping services can be done using the unload statement.Īpache should be functioning right now, more configuration details can be found everywhere on the internet, I’m not gonna explain the whole config file here… MariaDB (MySQL)Īgain, we use MacPorts: $ sudo port install mariadb-server When everything is configured, you can start Apache using MacPorts services: $ sudo port load apache2 Replace it with the following directive: ĭon’t forget to verify your changes after every modification you do to nf! $ /opt/local/apache2/bin/apachectl -t By default you have a block like this in your Apache config: You must also allow traffic to go to your webserver otherwise you will get “Permission denied” errors. To do this change /opt/local/apache2/htdocs to your local sites folder e.g. Probably you want to set DocumentRoot to your local Sites folder. Whenever your installation is completed, you can edit Apache’s configuration file: /opt/local/apache2/conf/nf. Time to install Apache: $ sudo port install apache2 Web sharing can be found under ‘System preferences’, ‘Sharing’, … If you have web sharing enabled on your Mac, you should disable it before continuing. You could also install them using Homebrew, or use the packages that come with your Mac, but I prefer MacPorts… So if you don’t have MacPorts installed, follow the installation instruction on their website.īefore installing any ports, make sure you have the latest version of the ports tree: $ sudo port selfupdate Apache In this guide I will use it to install Apache, MariaDB and PHP. The tool is very handy when it comes to installing command line tools for Mac. The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the OS X operating system. MacPorts is a BSD ports like package management system for OS X. If you want to update your current PHP 5 installation to a PHP 7 installation, see this blogpost: Migrating/updating from PHP 5 to PHP 7 on OS X (MacPorts). The easiest way is to use the MAMP interface and just click on the Start / Stop Servers button.Update: I updated the blogpost for PHP 7 instead of PHP 5. The default solution is to clear your cache and this usually does the trick. Some users have experience issues with phpMyAdmin, usually relating to being unable to log in. If you want to manually stop and restart Apache from the Terminal then you can also do this. I usually find that a restart of the computer will solve most issues. ![]() The only issues I have experience with MAMP relate to the starting and stopping of the Apache server and the MySQL server. ![]() WHAT ARE THE COMMON ISSUES WHEN USING MAMP ON MAC? However, I do like to restart my computer before an install. Fortunately, Mac OSX is very stable and I have personally never experienced any issues with installing software. In fact, I often recommend this before installing any program. You may wish to consider restarting your computer before you install MAMP. ![]() Not many! Thankfully there are few issues associated with installing MAMP. WHAT ARE THE COMMON ISSUES WHEN INSTALLING MAMP ON MAC? If everything is working then you should see the Hello, World! message displayed in your browser. ![]() I suggest that you bookmark this page for quick reference. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |