ubuntu 12.04 配置nginx mysql php5_MySQL
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 //当你每次加载新模块后,都要执行
推荐阅读
-
Gentoo 下安装与配置Nginx+ MySQL + PHP (fastcgi) 环境步骤分享
-
Ubuntu下Nginx配置ThinkPHP的Pathinfo和URl Rewrite模式
-
Ubuntu安装PHP和PHP Nginx配置方法
-
ubuntu上配置Nginx+PHP5 FastCGI服务器配置
-
ubuntu10.04配置 nginx+php-fpm模式的详解
-
Centos搭建PHP5.3.8+Nginx1.0.9+Mysql5.5.17详细配置
-
#实践笔记#Ubuntu配置Apache+PHP+MySQL
-
Ubuntu+Nginx+Mysql+Php+Zend+eaccelerator安装配置文字版
-
CentOS6 配置Nginx,MySql,php-fpm开机启动的方法
-
Ubuntu中Nginx的安装与配置详细说明