ubuntu 13.04 nginx php 安装
之前一直摸索,百度好多文章,得出一个最简单的安装方法,但是不知道是否正确,或者有什么遗漏的。
1.安装nginx
sudo apt-get install nginx
2.安装php
sudo apt-get install php5-fpm
3.配置nginx
sudo gedit /etc/nginx/sites-available/default
root /www;
index index.html index.htm index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
}
4.启动nginx
sudo service nginx start
安装完毕,现在有两个问题,网上的很多文章都差不多,主要的差异在PHP安装和nginx配置哪里。
1.php是否只需要安装php5-fpm即可?
2. location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
include fastcgi_params;
}
各行的配置分别代表什么意思?
3.为什么使用fastcgi_pass 127.0.0.1:9000;就无法启动nginx?
回复讨论(解决方案)
没装过,过来看看。
建议贴出代码以供分析
首先,我建?你用centsos?作?php的服?器系?,他比ubuntu更?定,?一?你可以搜索一下centos的?史即可?解.
sudo apt-get install nginx
sudo是?了提升?限 apt-get install是直接?ubuntu的?像取得安?包安?.
在centos里的命令是 yum install nginx
在linux上搭建PHP?境非常麻?,不?我建?下?lnmp???合?境,用???合?境安?完?之後再??置nginx的?程?和fastcgi的一些高??定,?一部份非常麻?且重要,而且?有固定?置方法可供你?考,很多?西都要自己??摸索,因?每一台伺服器的硬件和性能不同,如果?置不好的?,你的?站?常常出???500或??502

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

The enumeration function in PHP8.1 enhances the clarity and type safety of the code by defining named constants. 1) Enumerations can be integers, strings or objects, improving code readability and type safety. 2) Enumeration is based on class and supports object-oriented features such as traversal and reflection. 3) Enumeration can be used for comparison and assignment to ensure type safety. 4) Enumeration supports adding methods to implement complex logic. 5) Strict type checking and error handling can avoid common errors. 6) Enumeration reduces magic value and improves maintainability, but pay attention to performance optimization.

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.
