GithubHelp home page GithubHelp logo

macos-nginx-php's Introduction

Nginx configuration for Mac OS X PHP Projects.

Introduction

This is a nginx configuration for various PHP projects.

It is inspired by the work of perusio and rellimevad. Installation instructions initially found here.

Supported projects

  • WordPress (currently does not support wp-supercache)
  • Symfony 2

Requirements

Installation

This will describe all the steps required to install everything. All of this is done through Terminal.

Databases

MySQL

Installation steps.

brew install mysql

unset TMPDIR

mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

mysql.server start

Finally, MySQL is configured using this command:

/usr/local/Cellar/mysql/5.5.20/bin/mysql_secure_installation

MongoDB

brew install mongodb

PostgreSQL

brew install postgresql

For new installations, You need to initialize the database:

initdb /usr/local/var/postgres -E utf8

PHP and other libraries

This step will explain how to install PHP with fpm as well as other libraies you might need for your projects.

Please note that additional configuration options will be supplied by the homebrew installer. Please follow those directions.

PHP with Homebrew

There is no formula by default, but there is a github project maintainging all php brews. You can find it here.

PHP with fpm

You can omit the --with-mysql --with-pgsql if you will not be using it.

brew install php54 --with-mysql --with-pgsql --with-fpm

APC

brew install php54-apc

mongo-php

brew install php54-mongo

xdebug

brew install php54-xdebug

Nginx

First, install Nginx.

brew install nginx

Configuration

Importing our configuration requires us to replace the old config files. And cloning the git repo.

  1. Rename the default config directiory

    mv /usr/local/etc/nginx /usr/local/etc/nginx.old

  2. Clone the git repository from github. Or, alternatively, you can also download the files and copy the manually.

  3. Use the default configs in sites-available to create your site configs.

  4. Create a sites-enabled directory.

    mkdir /usr/local/etc/nginx/sites-enabled

  5. Create symlinks to your config files in sites-available in site-enabled using ln -s.

Project Configuration

Nginx User

By default, the user is nobody.

WordPress

You'll need to give write access to your WordPress folder to the nginx user. You'll also need to give ownership to the files to the nginx user if you want the automatic updates to work. This is done using chown -R nobody /path/to/wp. If you're using a different user, replace nobody by that user.

macos-nginx-php's People

Contributors

carlalexander avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.