安装环境
参见:
编写Nginx启停服务脚本
yum install -y autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
安装PHP
yum install -y PHP PHP-fpm PHP-MysqL PHP-devel PHP-mbstring PHP-gd
启动PHP-fpm
service PHP-fpm start
将PHP-fpm加入启动项
chkconfig --levels 2345 PHP-fpm on
查看
chkconfig --list | grep PHP-fpm
安装MysqL
- yum安装
yum install -y MysqL-server MysqL MysqL-devel
开启MysqL Server daemon (MysqLd)
service MysqLd start
MysqL -u root
修改 root 帐号的密码: (注: 这一步完成之后,下次使用MysqL -p -u root登录)
MysqL> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');
select user,host from MysqL.user; delete from MysqL.user where not (user="root"); MysqL> FLUSH PRIVILEGES; select user,host from MysqL.user;
MysqL> quit;
设置MysqLd开机启动
chkconfig --level 2345 MysqLd on && service MysqLd restart && chkconfig --list | grep MysqLd
======================================================
CentOS 7的yum源中貌似没有正常安装MysqL时的MysqL-sever文件,需要去官网上下载
# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # rpm -ivh MysqL-community-release-el7-5.noarch.rpm # yum install MysqL-community-server
附:
rpm-e需要卸载的安装包
在卸载之前,通常需要使用rpm-q…命令查出需要卸载的安装包名称。
ruby-1.8.7.352-7.el6_2.x86_64isaduplicatewithruby-1.8.7-1.el6.x86_64yum erase ruby
成功安装之后重启MysqL服务
# service MysqLd restart
如果仍不能下载,把原来的yum源里自定义的源删除。
=====================================
安装web服务器Nginx
下载链接:http://pan.baidu.com/s/1sjqknO5密码:7q59
yum install -y pcre-devel zlib-devel tar -zxf Nginx-1.5.3.tar.gz cd Nginx-1.5.3 ./configure --prefix=/opt/Nginx make && make install
查看配置信息是否正确(可以一起复制)
cd /opt/Nginx/sbin/ ./Nginx -t
启动Nginx
/opt/Nginx/sbin/Nginx
开机启动
echo /opt/Nginx/sbin/Nginx >> /etc/rc.local
开放80端口
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT /etc/init.d/iptables save service iptables restart
或直接关闭防火墙(可选)
service iptables stop
开机关闭防火墙(可选)
chkconfig --level 0123456 iptables off
配置Nginx
vim /opt/Nginx/conf/Nginx.conf
安装vim
yum install -y vim
重新加载
cd /opt/Nginx/sbin ./Nginx -s reload service PHP-fpm restart
启停Nginx的脚本
之后就可以
service Nginx restart重启了
原文链接:https://www.f2er.com/centos/380922.html安装PHPmyadmin
链接:http://pan.baidu.com/s/1i3pKD3f密码:et1z
tar -jxf PHPMyAdmin-4.0.6-all-languages.tar.bz2 mv PHPMyAdmin-4.0.6-all-languages PHPmyadmin mv PHPmyadmin/ /opt/Nginx/html/ cd /opt/Nginx/html/PHPmyadmin/ cp config.sample.inc.PHP config.inc.PHP
vim config.inc.PHP
修改下面2行:
$cfg['Servers'][$i]['controluser'] = 'root';// MysqL用户 $cfg['Servers'][$i]['controlpass'] = 'password'; // MysqL用户密码
重新加载
cd /opt/Nginx/sbin ./Nginx -s reload service PHP-fpm restart
问题:
Call to undefined function PMA_DBI_num_rows() in /opt/Nginx/html/PHPmyadmin/libraries/navigation/Nodes/Node.class.PHP