300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > centOS7.4服务器 yum安装 搭建lamp环境

centOS7.4服务器 yum安装 搭建lamp环境

时间:2020-12-04 13:44:45

相关推荐

centOS7.4服务器 yum安装 搭建lamp环境

// 红色加粗是linux命令

安装gcc和gcc-c++yum -y install gcc gcc-c++

yum list httpd*

安装apcheyum -y install httpd.x86_64 httpd-devel.x86_64 httpd-tools.x86_64开启服务/bin/systemctl start httpd.service停止服务/bin/systemctl stop httpd.service设置Apache服务开机启动systemctl enable httpd.service默认目录:/var/www/html/卸载yum remove httpd

安装mysql/007sx/p/7083143.html一、检查系统是否安装其他版本的MYSQL数据yum list installed | grep mysql#yum -y remove mysql-libs.x86_64二、安装及配置wget /mysql-community-release-el6-5.noarch.rpm# rpm -ivh mysql-community-release-el6-5.noarch.rpmyum repolist all | grep mysql安装MYSQL数据库yum install mysql-community-server -y设置为开机启动(2、3、4都是on代表开机自动启动)chkconfig --list | grep mysqld# chkconfig mysqld on三、设置远程root启动mysqlservice mysqld start设置root密码mysql_secure_installation登陆root账号mysql -uroot -p建立远程root用户mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你设置的密码' WITH GRANT OPTION;mysql> flush privileges;四、设置utf-8编码查看mysql原本编码:mysql> show variables like 'character%';mysql> \q设置编码vim /etc/f如下(少补):[mysqld]character-set-server=utf8 collation-server=utf8_general_ci sql_mode='NO_ENGINE_SUBSTITUTION'[mysql]default-character-set = utf8[mysql.server]default-character-set = utf8[mysqld_safe]default-character-set = utf8[client]default-character-set = utf8重启mysqlservice mysqld restart再次查看编码:mysql -uroot -pmysql> show variables like 'character%';+--------------------------+----------------------------+| Variable_name | Value |+--------------------------+----------------------------+| character_set_client | utf8 || character_set_connection | utf8 || character_set_database | utf8 || character_set_filesystem | binary || character_set_results | utf8 || character_set_server | utf8 || character_set_system | utf8 || character_sets_dir | /usr/share/mysql/charsets/ |+--------------------------+----------------------------+8 rows in set (0.00 sec)mysql> \q

安装PHP /pangguoming/p/6207970.html1.检查当前安装的PHP包yumlistinstalled|grepphp如果有安装的PHP包,先删除他们yumremovephp.x86_64php-cli.x86_64php-common.x86_64php-gd.x86_64php-ldap.x86_64php-mbstring.x86_64php-mcrypt.x86_64php-mysql.x86_64php-pdo.x86_642CentOs7.Xrpm-Uvh/yum/el7/epel-release.rpmrpm-Uvh/yum/el7/webtatic-release.rpm如果想删除上面安装的包,重新安装rpm -qa | grep webstaticrpm -e 上面搜索到的包即可

3.运行yum installyum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64

注:如果想升级到7.0把上面的56w换成70w就可以了。yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

4.安装PHP FPM,以后需要可以单独安装插件yum install php56w-fpmyum install php70w-fpm

djl补充安装的扩展yum install php56w-xml.x86_64 php56w-xmlrpc.x86_64 php56w-devel.x86_64yum install php56w-bcmath.x86_64 php56w-odbc.x86_64

安装php完成后,重启apache/bin/systemctl restart httpd.service

//查看有哪些可以yum安装的扩展

yum list php56w*Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * webtatic: uk.Installed Packagesphp56w.x86_64 5.6.35-1.w7 @webtaticphp56w-cli.x86_64 5.6.35-1.w7 @webtaticphp56w-common.x86_64 5.6.35-1.w7 @webtaticphp56w-gd.x86_64 5.6.35-1.w7 @webtaticphp56w-ldap.x86_64 5.6.35-1.w7 @webtaticphp56w-mbstring.x86_64 5.6.35-1.w7 @webtaticphp56w-mcrypt.x86_64 5.6.35-1.w7 @webtaticphp56w-mysql.x86_64 5.6.35-1.w7 @webtaticphp56w-pdo.x86_64 5.6.35-1.w7 @webtaticAvailable Packagesphp56w-bcmath.x86_64 5.6.35-1.w7 webtatic php56w-dba.x86_64 5.6.35-1.w7 webtatic php56w-devel.x86_64 5.6.35-1.w7 webtatic php56w-embedded.x86_64 5.6.35-1.w7 webtatic php56w-enchant.x86_64 5.6.35-1.w7 webtatic php56w-fpm.x86_64 5.6.35-1.w7 webtatic php56w-imap.x86_64 5.6.35-1.w7 webtatic php56w-interbase.x86_64 5.6.35-1.w7 webtatic php56w-intl.x86_64 5.6.35-1.w7 webtatic php56w-mssql.x86_64 5.6.35-1.w7 webtatic php56w-mysqlnd.x86_64 5.6.35-1.w7 webtatic //安装报错php56w-odbc.x86_64 5.6.35-1.w7 webtatic php56w-opcache.x86_64 5.6.35-1.w7 webtatic php56w-pear.noarch 1:1.10.4-1.w7 webtatic php56w-pecl-apcu.x86_64 4.0.11-2.w7 webtatic php56w-pecl-apcu-devel.x86_64 4.0.11-2.w7 webtatic php56w-pecl-gearman.x86_64 1.1.2-1.w7 webtatic php56w-pecl-geoip.x86_64 1.1.1-1.w7 webtatic php56w-pecl-igbinary.x86_64 2.0.5-1.w7 webtatic php56w-pecl-igbinary-devel.x86_64 2.0.5-1.w7 webtatic php56w-pecl-imagick.x86_64 3.4.3-1.w7 webtatic php56w-pecl-imagick-devel.x86_64 3.4.3-1.w7 webtatic php56w-pecl-libsodium.x86_64 1.0.6-1.w7 webtatic php56w-pecl-memcache.x86_64 3.0.8-2.w7 webtatic php56w-pecl-memcached.x86_64 2.2.0-1.w7 webtatic php56w-pecl-mongodb.x86_64 1.4.1-1.w7 webtatic php56w-pecl-redis.x86_64 3.1.6-1.w7 webtatic php56w-pecl-xdebug.x86_64 2.5.5-2.w7 webtatic php56w-pgsql.x86_64 5.6.35-1.w7 webtatic php56w-phpdbg.x86_64 5.6.35-1.w7 webtatic php56w-process.x86_64 5.6.35-1.w7 webtatic php56w-pspell.x86_64 5.6.35-1.w7 webtatic php56w-recode.x86_64 5.6.35-1.w7 webtatic php56w-snmp.x86_64 5.6.35-1.w7 webtatic php56w-soap.x86_64 5.6.35-1.w7 webtatic php56w-tidy.x86_64 5.6.35-1.w7 webtatic php56w-xml.x86_64 5.6.35-1.w7 webtatic php56w-xmlrpc.x86_64 5.6.35-1.w7 webtatic

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。