登录  /  注册
ubuntu 搭建LNMP + Yii
php中文网
发布: 2016-07-29 08:57:38
原创
647人浏览过

安装Mysql

apt-get install mysql-server mysql-client
默认安装的是5.5版本,并不是最新版本
过程较简单,不多描述。

安装Nginx

apt-get install nginx
默认版本1.4.6
卸载脚本: apt-get –purge remove nginx

如果要装最新版本可以这样操作:
1、把nginx的apt源加入/etc/apt/sources.list
复制
deb http://nginx.org/packages/ubuntu/ trusty nginx
deb-src http://nginx.org/packages/ubuntu/ trusty nginx
添加至/etc/apt/sources.list文件中
以上配置可能有更新,最新配置可参考:http://nginx.org/en/linux_packages.html#stable

2、更新apt-key
wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
如果不执行这一步,执行以下步骤时会出现类似这样的错误:
GPG error: http://nginx.org precise Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62

3、更新apt
apt-get update

4、重新安装nginx
apt-get install nginx

5、安装完后访问localhost,如果有nginx的欢迎页,则代表安装成功。
sudo service nginx restart // 重启

安装PHP5

apt-get install php5-fpm
apt-get install php5-cgi php5-mysql php5-curl php5-gd php5-imagick php5-mcrypt
php5-memcache php5-sqlite php5-xmlrpc php5-json php5-common php5-dev php5-redis

查看php5运行进程
ps -waux | grep php5
打开关闭php5进程
sudo service php5-fpm stop
sudo service php5-fpm start
sudo service php5-fpm restart
sudo service php5-fpm status

配置

vim /etc/nginx/conf.d/default.conf
1、指定好正确的root
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
}
location = /50x.html {
root /usr/share/nginx/html;
}
2、开启对php的支持
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php{
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
document_root$fastcgi_script_name;
include fastcgi_params;
}

vim /etc/php5/fpm/php.ini
cgi.fix_pathinfo = 1 把注释去掉

vim /etc/php5/fpm/pool.d/www.conf
;listen = /var/run/php5-fpm.sock
listen = 127.0.0.1:9000

配置完毕!

下载yii框架代码

http://www.yiichina.com/doc/guide/2.0/start-installation

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介绍了ubuntu 搭建LNMP + Yii,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

  • 相关标签:
    来源:php中文网
    本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
    最新问题
    热门教程
    更多>
    最新下载
    更多>
    网站特效
    网站源码
    网站素材
    前端模板
    关于我们 免责申明 意见反馈 讲师合作 广告合作 技术文章
    php中文网:公益在线php培训,帮助PHP学习者快速成长!
    关注服务号 技术交流群
    PHP中文网订阅号
    每天精选资源文章推送
    PHP中文网APP
    随时随地碎片化学习
    PHP中文网抖音号
    发现有趣的

    Copyright 2014-2023 //m.sbmmt.com/ All Rights Reserved | 苏州跃动光标网络科技有限公司 | 苏ICP备2020058653号-1

     | 本站CDN由 数掘科技 提供

    登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学