You can use MySQL through command line but this is a good way to administer MySQL. You can either change permissions like this: chmod 755 directory/ or you can change the ownership of the directory to the apache user and group: chown -R _www:_www directory 5. The Apache user( _www) needs to have access to read, and sometimes write, your web directory. You may recieve 403 forbidden when you visit your local site. Now we need to ensure PHP and MySQL: cd /varĪll your sites would have URLs like pointing to /Library/WebServer/Documents/some-site. Type '\c' to clear the current input statement. Other names may be trademarks of their respective Oracle is a registered trademark of Oracle Corporation and/or itsĪffiliates. The current MAMP 1.9 includes Apache 2.0.63 (dated, but depending on your production site, this may be a closer fit if your provider uses Apache 2.0.x rather than 2.2.x), MySQL 5.1.44, PHP 5.2.13. Commands end with or \g.Ĭopyright (c) 2000, 2017, Oracle and/or its affiliates.
Mac os x apache mysql php stack password#
Enter password and then something like this appear: Welcome to the MySQL monitor. It will ask you write the password you set for mysql before. Reload privilege tables now - Choose yesĪfter finishing this up, test MySQL: mysql -uroot -p.Now configure MySQL : mysql_secure_installation Now start MySQL: brew services start mysql
Mac os x apache mysql php stack install#
Install brew services now: brew tap homebrew/services Now Restart apache: sudo apachectl restart 3.
Now uncomment the following line (Remove #): LoadModule php5_module libexec/apache2/libphp5.so Now edit the nf with vi or any other text editor: vi nf This will help you to cross check later what you changed or in case you want to restore the configuration to default. Let's make a backup of the default Apache configuration. Open your browser and access If it says It Works, then you are set otherwise see if your apachectl has started or not. Open Terminal and run the following Code: sudo apachectl start
?? Get my newsletter for occasional updates./usr/bin/ruby -e "$(curl -fsSL )" 1.
If you want to start MySQL automatically, run: brew services start mysqlĪny comments? Ping me on Twitter. Once Homebrew is installed, installing MySQL is as simple as: brew install mysql Instead of going for an installer package, we’ll use Homebrew. MySQL is not shipped with macOS, so we’ll have to install that manually. If you also need PEAR/PECL, follow these instructions. To activate these settings you have to restart Apache: sudo apachectl restart You should also configure a few settings in /etc/php.ini: sudo tee -a /etc/php.ini << EOFĭate.timezone = "`sudo systemsetup -gettimezone | awk ''`" LoadModule php7_module libexec/apache2/libphp7.so So we’ll also add it to our config: sudo tee -a /etc/apache2/other/ $USER nf << EOF LoadModule rewrite_module libexec/apache2/mod_rewrite.so It seems that mod_rewrite no longer gets loaded by default, so we’ll also add that to our config: sudo tee -a /etc/apache2/other/ $USER nf << EOF Include /private/etc/apache2/extra/nfĪfter that, configure vhosts as necessary in /etc/apache2/extra/nf (don’t forget to remove the examples in there). If you want to use vhosts, you’ll also have to make sure that the vhosts config gets loaded: sudo tee -a /etc/apache2/other/ $USER nf << EOF Include /private/etc/apache2/users/*.conf Now we have to make sure that our user config above actually gets loaded: sudo tee -a /etc/apache2/other/ $USER nf << EOF Options Indexes MultiViews FollowSymLinks Then add a configuration for your user: sudo tee /etc/apache2/users/ $nf Apacheįirst, you have to create a web root in your user account: mkdir ~/Sites Future versions of macOS will not include PHP. Apple added the following deprecation warning: PHP is included in macOS for compatibility with legacy software. Apple macOS 11.0 ships with both a relatively recent version of Apache (2.4.x), as well as PHP (7.3.x), so you’ll just have to install MySQL and go through a few steps to get everything up and running.īig Sur will likely be the last version of macOS that ships with PHP.