centOS7.4服务器 yum安装 搭建lamp环境
生活随笔
收集整理的這篇文章主要介紹了
centOS7.4服务器 yum安装 搭建lamp环境
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
// 紅色加粗是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開啟服務(wù)/bin/systemctl start httpd.service停止服務(wù)/bin/systemctl stop httpd.service設(shè)置Apache服務(wù)開機(jī)啟動systemctl enable httpd.service默認(rèn)目錄:/var/www/html/卸載yum remove httpd
安裝mysqlhttps://www.cnblogs.com/007sx/p/7083143.html一、檢查系統(tǒng)是否安裝其他版本的MYSQL數(shù)據(jù)yum list installed | grep mysql#yum -y remove mysql-libs.x86_64二、安裝及配置wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm# rpm -ivh mysql-community-release-el6-5.noarch.rpmyum repolist all | grep mysql安裝MYSQL數(shù)據(jù)庫yum install mysql-community-server -y設(shè)置為開機(jī)啟動(2、3、4都是on代表開機(jī)自動啟動)chkconfig --list | grep mysqld# chkconfig mysqld on三、設(shè)置遠(yuǎn)程root啟動mysqlservice mysqld start設(shè)置root密碼mysql_secure_installation登陸root賬號mysql -uroot -p 建立遠(yuǎn)程root用戶mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你設(shè)置的密碼' WITH GRANT OPTION;mysql> flush privileges;?四、設(shè)置utf-8編碼查看mysql原本編碼:mysql> show variables like 'character%';mysql> \q設(shè)置編碼vim /etc/my.cnf如下(少補(bǔ)):[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 https://www.cnblogs.com/pangguoming/p/6207970.html1.檢查當(dāng)前安裝的PHP包yum?list?installed?|?grep?php如果有安裝的PHP包,先刪除他們yum?remove?php.x86_64?php-cli.x86_64?php-common.x86_64?php-gd.x86_64?php-ldap.x86_64?php-mbstring.x86_64?php-mcrypt.x86_64?php-mysql.x86_64?php-pdo.x86_642?CentOs?7.Xrpm?-Uvh?https://mirror.webtatic.com/yum/el7/epel-release.rpmrpm?-Uvh?https://mirror.webtatic.com/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-fpm?yum install php70w-fpm
djl補(bǔ)充安裝的擴(kuò)展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安裝的擴(kuò)展
yum list php56w*Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * webtatic: uk.repo.webtatic.comInstalled 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轉(zhuǎn)載于:https://www.cnblogs.com/idjl/p/9610556.html
總結(jié)
以上是生活随笔為你收集整理的centOS7.4服务器 yum安装 搭建lamp环境的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 现在洛克王国新手大礼包都有什么东西
- 下一篇: 电动车电机霍尔坏了换要多少钱轮承坏了换要