欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ubuntu 12.04 配置nginx mysql php5_MySQL

程序员文章站 2022-05-28 18:53:17
...
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 //当你每次加载新模块后,都要执行