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 //当你每次加载新模块后,都要执行
上一篇: 基于Python实现文件大小输出
推荐阅读
-
Ubuntu Server 16.04下mysql8.0安装配置图文教程
-
Ubuntu 18.04下mysql 8.0 安装配置方法图文教程
-
Ubuntu16.04 server下配置MySQL,并开启远程连接的方法
-
mysql 5.7.17 安装配置方法图文教程(ubuntu 16.04)
-
Linux(Ubuntu)下Mysql5.6.28安装配置方法图文教程
-
Linux(Ubuntu)下mysql5.7.17安装配置方法图文教程
-
mysql 5.7.16 安装配置方法图文教程(ubuntu 16.04)
-
在Debian下配置Python+Django+Nginx+uWSGI+MySQL的教程
-
Ubuntu安装MySQL5.7并配置数据存储路径的方法步骤
-
Ubuntu下nginx编译安装参数配置