Home php教程 php手册 nginx 部署:在cygwin下部署PHP环境,mssql+PHP +nginx+freetds

nginx 部署:在cygwin下部署PHP环境,mssql+PHP +nginx+freetds

Jun 21, 2016 am 08:49 AM
freetds nginx php server


因为公司的环境是在linux下,所以想在自己的机器上搭建个模仿linux的环境
环境为linux +mssql+PHP +nginx+freetds
于是就想到了cygwin
去http://www.cygwin.com 下载setup.exe
然后安装,安装方法网上一大堆,主要是要安装好GCC相关的东西,我是把 devel目录下的东西都安装上
默认是default 点击下default 可以变成install
下载nginx
http://nginx.org/download/nginx-1.2.6.tar.gz
安装
tar zxvf nginx-1.2.6.tar.gz
cd nginx-1.2.6
./configure
make && make install
如果没有提示出错的话就是安装好了,进入默认的安装目录 cd /usr/local/nginx
cd sbin
如果有nginx.exe就说明安装成功了 要启动nginx ./nginx.exe就行了
就可以用ps -efgrep nginx看到进程了
然后是安装freetds
去http://www.freetds.org/下载freetds
ftp://ftp.freetds.org/pub/freetds/stable/freetds-stable.tgz
安装跟nginx一样
tar freetds-stable.tgz
cd freetds-0.91
./configure
make && make install
然后安装PHP
下载PHP
http://us1.php.net/distributions/php-5.4.11.tar.gz

tar php-5.4.11.tar.gz
cd php-5.4.11
./configure --prefix=/usr/local/php --enable-mbstring --enable-sockets --with-config-file-path=/usr/local/php --with-mssql=/usr/local/freetds --enable-fpm
make && make install
一些警告忽略掉,然后启动PHP
cd /usr/local/php/sbin/
./php-fpm.exe 就可以启动php fpm了
但是用CI框架 发现
$_SERVER['SCRIPT_NAME']获取URL的路径有问题

正常$_SERVER['REQUEST_URI'] 获取的是/index.php/welcome
$_SERVER['SCRIPT_NAME'] 获取的应该是/index.php
但是我的cygwin获取的是 $_SERVER['REQUEST_URI'] 获取的是/index.php/welcome
$_SERVER['SCRIPT_NAME'] 获取的应该是/index.php/welcome
两个是一样的,这样就有问题了,
还有一个是下载了PHPredis安装也没出错,但是 在php.ini加扩展时总是提示出错
NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/redisa' - Exec format error in Unknown on line 0

怀疑是不是PHP没安装好,因为有很多警告,不知道有没有发生过错误,待重新安装一次确认下
安装redis时 会报redis.c:1xxx: error: `SA_ONSTACK' undeclared (first use in this function) 的错误
因为cygwin里没有定义SA_ONSTACK
在sys/resource.h中加上
ifndef SA_ONSTACK
define SA_ONSTACK 0
endif 本文链接http://www.cxybl.com/html/wlbc/Php/20130601/38184.html



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

CakePHP Quick Guide CakePHP Quick Guide Sep 10, 2024 pm 05:27 PM

CakePHP is an open source MVC framework. It makes developing, deploying and maintaining applications much easier. CakePHP has a number of libraries to reduce the overload of most common tasks.

CakePHP Logging CakePHP Logging Sep 10, 2024 pm 05:26 PM

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide

See all articles