centos6.5 x86_64下yum安装lnmp+phpmyadmin

平台:centos6.5 x86_64

1,关闭SElinux

vi /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled

reboot

2,添加yum源

rpm -Uvh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

3,安装基本库

yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl–devel pcre pcre-devel

4,安装mysql和nginx

yum install -y nginx mysql mysql-server mysql-devel

5,安装php

yum install -y php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm

6,配置mysql

chkconfig mysqld on

service mysqld start

为root账户设置密码

mysql_secure_installation

/usr/local/mysql/bin/mysql -u root -p 输入密码

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘password‘;

FLUSH PRIVILEGES;

7,配置PHP

chkconfig php-fpm on

cp /etc/php.ini /etc/php.ini.bk

sed -i ‘s/;date.timezone =/date.timezone = PRC/g‘ /etc/php.ini

sed -i ‘s/; cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g‘ /etc/php.ini

sed -i ‘s/; cgi.fix_pathinfo=0/cgi.fix_pathinfo=0/g‘ /etc/php.ini

sed -i ‘s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g‘ /etc/php.ini

sed -i ‘s/max_execution_time = 30/max_execution_time = 300/g‘ /etc/php.ini

sed -i ‘s/disable_functions =.*/disable_functions = passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g‘ /etc/php.ini

cp /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.confbak

vi /etc/php-fpm.d/www.conf

#修改用户为nginx

user = nginx

#修改组为nginx

group = nginx

service php-fpm start

8,配置nginx

chkconfig nginx on

cp /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.confbak

vi /etc/nginx/conf.d/default.conf

#location / {

root   /usr/share/nginx/html;

index  index.php index.html index.htm;

#}

修改以下代码

# location ~ \.php$ {

#    root       html;

#    fastcgi_pass   127.0.0.1:9000;

#    fastcgi_index  index.php;

#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;

#    include        fastcgi_params;

#}

去掉除root行外的#,/scripts 改成$document_root

service nginx start

9,测试

vi /usr/share/nginx/html/index.php

<?php

$link=mysql_connect("localhost","root","password","mysql");

echo ‘<br/>‘;

if($link){

echo ‘connection is ok‘;

mysql_close($link);

}

else

echo ‘try config again‘;

?>

显示connection is ok,说明php和mysql已整合,留意iptables状态

10,加上phpmyadmin,安装完php是5.3.3,mysql 5.1.73,根据mysql版本下载对应的phpmyadmin版本,http://www.phpmyadmin.net/downloads/

wget https://files.phpmyadmin.net/phpMyAdmin/4.0.10.10/phpMyAdmin-4.0.10.10-all-languages.zip

tar zxvf phpMyAdmin-4.0.10.10-all-languages.tar.gz

mv phpMyAdmin-4.0.10.10-all-languages phpmyadmin

mv phpmyadmin /usr/share/nginx/html/

chown -R nginx.nginx /var/lib/php/session

OK,http://yourserverip/phpmyadmin,输入MySQL用户名和密码,enjoy it.

php的扩展模块需要再自行添加并修改配置哈

时间: 2024-10-12 21:22:16

centos6.5 x86_64下yum安装lnmp+phpmyadmin的相关文章

centos6.5 x86_64下yum安装lnmp+phpmyadmin(2)

平台:centos6.5 x86_64最小化安装 上篇是安装的php.mysql版本有点老,安装个版本新一点的,尝尝鲜.^_^ 1,关闭SElinux vi /etc/selinux/config 将SELINUX=enforcing改为SELINUX=disabled reboot 2,添加yum源 vi nginx.repo                   nginx的源 [nginx] name=nginx repo baseurl=http://nginx.org/packages/

centos6.5 x86_64下编译安装lnmp(2)

紧接上篇 6,安装nginx 1)安装 Nginx的rewrite模块支持包pcre库 tar zxvf pcre-8.36.tar.gz cd pcre-8.36/ ./configure make && make install cd ../ ln -s /lib64/libpcre.so.0.0.1 /lib64/libpcre.so.1 2)安装 Nginx tar zxvf nginx-1.8.0.tar.gz cd nginx-1.8.0/ ./configure --user

centos6.5 x86_64下编译安装strongswan

centos6.5 x86_64 1,安装必须的库 yum update yum install pam-devel openssl-devel make gcc 2,下载strongswan wget http://download.strongswan.org/strongswan.tar.gz tar xzf strongswan.tar.gz cd strongswan-* 3,编译安装 ./configure  --enable-eap-identity --enable-eap-md

centos6.5下yum安装lnmp(适合刚入职的新手的方法)

新入职的员工,开始的时候都是让配环境,本地写代码用的wamp,在lnmp或lamp测试,除非有些土豪公司 用的是(果机). 另外安装时,把整个流程在脑子里先过一篇(记不全也没关系,一回生二回熟),重在实践,实践出真知! 一:首先要在自己电脑安装一个虚拟主机软件,我这有: vmware10 ---> 网盘地址:http://pan.baidu.com/s/1pJt5HVl centos6.5(32位):网盘地址:http://pan.baidu.com/s/1pJqNLxD xshell4:  网

阿里云centos6(32bit)yum安装lnmp环境

========================================================================================= 挂载数据盘 https://help.aliyun.com/knowledge_detail/5974154.html fdisk -l 执行"fdisk  /dev/xvdb"命令,对数据盘进行分区: 根据提示,依次输入"n","p""1",两次回

centos下yum安装lamp和lnmp轻松搞定

centos下yum安装lamp和lnmp轻松搞定,到底多轻松你看就知道了,妈妈再也不担心不会装lamp了. 很辛苦整理的安装方法,会持续更新下去.凡无法安装的在评论里贴出问题来,会尽快解决.共同维护一个可用yum可用更新. 软件列表:php5.4 apache2.2 mysql5.5 nginx1.8 centos6.x rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ng

centos下编译安装LNMP环境

自PHP-5.3.3起,PHP-FPM加入到了PHP核心,编译时加上--enable-fpm即可提供支持. PHP-FPM以守护进程在后台运行,Nginx响应请求后,自行处理静态请求,PHP请求则经过fastcgi_pass交由PHP-FPM处理,处理完毕后返回. Nginx和PHP-FPM的组合,是一种稳定.高效的PHP运行方式,效率要比传统的Apache和mod_php高出不少. 二.依赖环境 yum -y install gcc gcc-c++ make cmake automake au

RHEL5.6环境下yum安装MySQL

RHEL5.6环境下yum安装MySQL记录,2017年2月20日 1.卸载原有的MySQL rpm -qa命令查询是否安装了MySQL [[email protected] mysql]# rpm -qa|grep mysql mysql-server-5.0.77-4.el5_5.4 mysql-5.0.77-4.el5_5.4 使用rpm -e命令卸载安装包,如果卸载时提示依赖可以增加"--nodeps"参数: 如果想删除依赖项则直接卸载依赖项后再删除相应的包. [[email 

CentOS7系统下YUM安装安装Mongodb 3.4

CentOS7系统下YUM安装安装Mongodb 3.4 第一步 查看是否存在Mongodb配置yum源 切换到yum目录 cd /etc/yum.repos.d/ 查看文件 ls 第二部 不存在添加yum 源 创建文件 touch mongodb-3.4.repo 编辑该文件 vi mongodb-3.4.repo 内容 : cat /etc/yum.repos.d/mongodb-3.4.repos [mongodb-org-3.4] name=MongoDB Repository base