centos php+mysql+nginx基础环境搭建
来源:互联网 发布:centos ip 命令不存在 编辑:程序博客网 时间:2024/06/14 20:18
版本号
使用的是 centos6.7
中文输入法
yum install “@Chinese Support”
System->Input Method->Enable input method feature->Input Method
添加中文拼音后,重启系统即可
添加源
这里主要使用yum安装方式,所以需要更新yum源
rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
关闭selinux
编辑
/etc/selinux/configSELINUX=disabled #将参数改成这个
安装nginx
yum install nginx # 或者yum install nginx18.x86_64service nginx startchkconfig nginx on #设为开机启动
安装php
这里要安装php5.5以上
默认到源只能到5.3
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64yum install php55w-fpm chkconfig php-fpm on netstat -antpl (如果看到9000端口,PHP-FPM配置成功)
配置nginx支持php
修改时区
vi /etc/php.ini #编辑
date.timezone = PRC
修改nginx配置
# vi /etc/nginx/conf.d/default.conf修改配置,添加以下配置 location ~ \.php$ { root your/web/path; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /your/web/path$fastcgi_script_name; include fastcgi_params;}
service nginx reload
在默认目录下添加index.php
<?phpphpinfo();?>
访问localhost,配置正确则可以看见php配置页面
安装mysql
安装源
wget http://repo.mysql.com//mysql57-community-release-el6-8.noarch.rpmyum localinstall mysql57-community-release-el6-8.noarch.rpm yum install mysql-servermysqld_safe --skip-grant-tables#重置密码使用update mysql.user set authentication_string=password('123') where user='root' and Host = 'localhost';flush privileges;#登录以后会仍会报错,就使用以下命令再次重置密码set global validate_password_policy=0;#降低密码验证等级set password =password('root1234');
安装phpmyadmin
yum install phpmyadmin
配置nginx
新建phpmyadmin.conf,添加内容
server { listen 80 ; server_name a.com;#自己的域名 index index.php; location / { root /usr/share/phpMyAdmin;#使用yum安装到目录 } location ~ \.php$ { root /usr/share/phpMyAdmin; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin$fastcgi_script_name; include fastcgi_params; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } location ~/\.ht{ deny all; }}
phpstorm开启xdebug
yum install php-pecl-xdebug#vi /etc/php.d/xdebug.ini#添加以下代码xdebug.remote_enable=onxdebug.remote_handler=dbgpxdebug.remote_port=9999output_buffering=offxdebug.idekey=PHPSTORM
在phpstorm中,file->settings->php->debug->xdebug中port填写9999(和配置项中相同即可)
0 0
- centos php+mysql+nginx基础环境搭建
- CentOS + Nginx + PHP + MySQL 环境搭建
- centos yum搭建nginx php mysql 环境
- CentOS+Nginx+PHP+Mysql+安全指南全环境搭建笔记
- 搭建CentOS+Nginx+PHP+MySQL标准生产环境
- centos 6u5 搭建nginx+php+mysql环境。
- centos 下lnmp(linux+nginx+mysql+php)环境搭建
- CentOS 7 yum nginx MySQL PHP 简易环境搭建
- CentOS 7 yum nginx MySQL PHP 简易环境搭建
- CentOS 7 yum nginx MySQL PHP 简易环境搭建
- CentOS 7 yum nginx MySQL PHP 简易环境搭建
- CentOS 7 yum nginx MySQL PHP 简易环境搭建
- CentOS 7 yum nginx MySQL PHP 简易环境搭建
- nginx+php +mysql环境搭建
- CentOS下搭建nginx+php环境
- Centos搭建Python+Nginx+Tornado+Mysql环境
- 测试环境搭建之centos系统编译安装nginx+php环境另加独立mysql
- centos搭建Nginx+PHP+MySql+Redis环境详细步骤(CentOS7环境)
- App弱网测试与常用模拟工具
- 017-JG JNLE(大于转移)指令+
- 搭建 AngularJS+Ionic+Cordova开发APP----- win10环境运行一个Ionic_demo
- 四种mysql存储引擎
- 018-JL,JNGE JLE,JNG JG,JNLE JGE,JNL带符号条件转移指令小结
- centos php+mysql+nginx基础环境搭建
- 不同操作系统的换行符
- 019-无符号数条件转移指令JA JNBE(大于)
- Python 列表(List)
- Android MultiDex实践:如何绕过那些坑?
- HDU1070-Milk
- 为VMware虚拟机内安装的Ubuntu 16.04设置静态IP地址(NAT方式)
- Angular2 RC6 Route学习
- 递归思想查找文件