Brew install apache php mysql
Install homebrew: Open Terminal and run the following Code: Open your browser and access http://localhost. If it says It Works, then you are set otherwise
see if your apachectl has started or not. Let's make a backup of the default Apache configuration. This will help you to cross check later what you changed or in case you want to restore the configuration to default.
Now edit the httpd.conf with vi or any other text editor: Now uncomment the following line (Remove #): Now Restart apache:
To install MySQL: Install brew services now: Now start MySQL: Now configure MySQL :
After finishing this up, test MySQL:
It will ask you write the password you set for mysql before. Enter password and then something like this appear:
4. Connect PHP and MySQLNow we need to ensure PHP and MySQL:
All your sites would have URLs like http://locahost/some-site pointing to /Library/WebServer/Documents/some-site. Note on PermissionsYou may recieve 403 forbidden when you visit your local site. The Apache user( You can either change permissions like this: 5. Install PHPMyAdminThis is optional. You can use MySQL through command line but this is a good way to administer MySQL. Download phpmyadmin from site.
Done! Done! Done!
|