Giter VIP home page Giter VIP logo

moldauder.github.com's Introduction

moldauder.github.com

something about me

moldauder.github.com's People

Contributors

moldauder avatar

Watchers

 avatar

moldauder.github.com's Issues

mac下通过brew安装nginx+php-fpm+mysql

nginx

  • 安装: brew install nginx
  • 配置
    • 配置文件位置:/usr/local/etc/nginx
    • 可在此目录下创建conf.d目录,放置虚拟站点配置文件
    • 如果想启用directory index,添加配置autoindex on。未启用此配置时如访问http://127.0.0.1,会出现403错误,配置后会列出目录结构。还有可能是目录的权限问题,这个需要另行解决
  • 启动
    • sudo nginx
    • 帮助:nginx -h

php-fpm

可以直接使用mac自带的phpphp-fpm,启动:sudo /etc/sbin/php-fpm

php的header函数中http_response_code参数

header函数的定义如下:

void header ( string $string [, bool $replace = true [, int $http_response_code ]] )

代码如下:

header('Location: http://www.google.com', TRUE, 200);

此时,如果要传递http_response_code,那么应该是302,此时的200应该是错误的。而根据手册上的描述:

The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless the 201 or a 3xx status code has already been set.

也就是当发送Location头时,需要返回302状态码(除非设定了201和3xx状态码)。实际情况是:

  • apache+php时,服务器返回200,导致不跳转
  • nginx+php-fpm时,200会被修正为302返回,前台仍能正常跳转

根据手册的描述,nginx+php-fpm进行了正确的处理。

fix Library not loaded error

like

dlopen(xxxxx.bundle, 9): Library not loaded: xxxx.dylib (LoadError)

then

otool -L xxxxx.bundle

show result

xxxx.dylib (compatibility version 18.0.0, current version 18.0.0)

then

install_name_tool -change xxxx.dylib right_dylib_path xxxxx.bundle,

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.