Home > Database > Mysql Tutorial > ubuntu 12.04 配置nginx mysql php5_MySQL

ubuntu 12.04 配置nginx mysql php5_MySQL

WBOY
Release: 2016-06-01 13:17:03
Original
951 people have browsed it

UbuntuNginx

1.apt-get install mysql-server mysql -client//安装数据库

2.apt-get install nginx //安装nginx

gedit /etc/nginx/sites-enabled/default //nginx配置文件

server {

root /home/angelmylove/download/zendphp/; //存放php文件的地址,等价与apache 的documentRoot
   index index.html index.htm index.php;
   # Make site accessible from http://localhost/
   server_name localhost;
   autoindex on; //这句话我每次不写都出错


   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.//安装有用的模块

apt-get install php5-fpm php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

4./etc/init.d/nginx stop

/etc/init.d/nginx start

5,serviec php5-fpm reload //当你每次加载新模块后,都要执行

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template