search
Homephp教程php手册ubuntu下的nginx+php+mysql配置

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 6、开始fast_cgi进程 1、sudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid 7、设置开机启动fastcgi进程并启动 sudo

欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入

 

  6、开始fast_cgi进程

  1、sudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid

  7、设置开机启动fastcgi进程并启动

  sudo vi /etc/rc.local

  添加下一行

  /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid

  如果打开php文件出现:No input file specified请检查php.ini的配置中

  cgi.fix_pathinfo=1

  doc_root=

  还有,每个虚机要根据自己不同的虚机设置不同的目录,要保证这个路径正确。

  检查/etc/nginx/sites-available下的配置文件中,server内包含 root 及地址 而非location内的root

  启动

  fast-cgisudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid

  参数含义如下

  * -f 指定调用FastCGI的进程的执行程序位置,根据系统上所装的PHP的情况具体设置

  * -a 绑定到地址addr

  * -p 绑定到端口port

  * -s 绑定到unix socket的路径path

  * -C 指定产生的FastCGI的进程数,默认为5(仅用于PHP)

  * -P指定产生的进程的PID文件路径

  * -u和-g FastCGI使用什么身份(-u 用户 -g 用户组)运行,Ubuntu下可以使用www-data,其他的根据情况配置,如nobody、apache等现在可以在web根目录下放个探针或php文件测试一下了

  8、安装mysql

  sudo apt-get install mysql-server mysql-client

  中间会提示输入Root用户密码,依次输入即可。

  启动MySQL

  sudo /etc/init.d/mysql start

  测试mysql服务是否正常:

  运行

  mysql -uroot -p

  输入mysql密码

  show databases;

  如果看到下面的内容

  | Database |

  | information_schema |

  | mysql |

  则mysql已正确安装了。

  至此,ubuntu下的nginx+php+mysql就安装完成了。

  [1] [2] 

ubuntu下的nginx+php+mysql配置

Statement
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

Video Face Swap

Video Face Swap

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

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 - How To Get Perfect Chroma Catalysts
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools