Create a file named php in conf.d folder cd conf.dĪdd the following contents to the file. Now create the configuration to use PHP-FPM for the php pages in conf.d directory. Nginx config file is usually found in the location below /usr/local/etc/nginxĬreate 3 directories in the location to hold the configuration, virtual host definitions and the log files. The final piece is to add virtual host configurations to access phpMyAdmin and your other websites using Nginx. To make sure that PHP-FPM started correctly, use the command below. Perhaps try installing via pip install mysqlclient if you need legacy python compatibility maybe try downloading brew and running brew install mysql-connector-c or brew install mysql.Let me know if any of that helps. Using the commands above, start Nginx(if not already started), MySQL and PHP-FPM Launchctl unload -w ~/Library/LaunchAgents/ rver stop launchctl load -w ~/Library/LaunchAgents/ Ln -sfv /usr/local/Cellar/php56/5.6.2/*.plist ~/Library/LaunchAgents/ sudo nginx Ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents/ ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents/ Mac will use the information in the plist files to launch the services at startup. plist files of the components in ~/Library/LaunchAgents. To make the services run at startup, provide a link to the. Now, lets configure the installed components and make sure they work as expected. Now, install phpMyAdmin brew install phpmyadmin Configurations which autoconfĮcho export PHP_AUTOCONF='/usr/local/bin/autoconf' > ~/.bash_profile brew install autoconfįind the value of autoconf path and set the PHP_AUTOCONF variable, then reload bash profile. If that does not return a value, install autoconf. If PHP_AUTOCONF is not setup, check if autoconf is installed. brew tap homebrew/dupesīrew install -without-apache -with-fpm -with-mysql php56 Install phpMyAdminīefore installing phpMyAdmin, check the value of $PHP_AUTOCONF by echoing it. We will tap a special channel to obtain this formula. The default PHP in Homebrew is different from the one that we need. brew install mysqlĪfter installing MySQL, set the root password and other options using mysql_secure_installation Install PHP-FPM Nginx configuration can be changed to use a different port and we will explore that shortly. ![]() Try to access and you should see the welcome page. This should start Nginx and will use the default port 8080. Install Nginx using the below commands brew install nginx Install it using ruby -e "$(curl -fsSL )"Īfter you install Homebrew, run the below commands brew doctor ![]() You can install, update packages easily via the command line. Its a CLI tool and is used in a way similar to YUM or APT. Apache can be replaced with the lightweight Nginx server and an NMP stack can be created, but may take a little more time to set it up.įollowing configuration is tested with Mac OS X v10.10 Yosemiteīefore we start, make sure that you install Homebrew – dubbed as the missing package manager for OS X. MAMP is a very easy solution to achieve this. An Apache, MySQL, PHP stack is really easy to setup on a Mac.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |