centos7 yum安裝 php的方法
centos7 yum安装php的方法:首先安装nginx以及MYSQL;然后通过命令“yum install php71w php71w-fpm php71w-cli php71w-common...”安装php以及扩展即可。
推荐:《php视频教程》
centos7 yum快速安装php7.1
1. 安装nginx
yum install nginx ##开启nginx service nginx start
2.安装MYSQL
yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm yum install mysql-community-server //开启mysql service mysqld start //查看mysql的root账号的密码 grep 'temporary password' /var/log/mysqld.log //登录mysql mysql -uroot -p //修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; //修改root用户可远程登录 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; //刷新 flush privileges;
3.安装php
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm //查看 yum search php71w //安装php以及扩展 yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath //开启服务 service php-fpm start //修改/etc/nginx/nginx.conf 使其支持php 见下 //重启nginx service nginx restart ---------------------配置
server { charset utf-8; client_max_body_size 128M; listen 80; ## listen for ipv4 server_name localhost; root /var/www/; index index.php; location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; } try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include fastcgi.conf; fastcgi_pass 127.0.0.1:9000; try_files $uri =404; } location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /etc/fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/?.*)$; fastcgi_param SCRIPT_FILENAME fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; } error_page 404 /404.html; location ~ /\.(ht|svn|git) { deny all; } }
4.安装redis
yum install redis //修改配置 vi /etc/redis.conf //daemonize yes 后台运行 //appendonly yes 数据持久化 service redis start
5.安装php-redis扩展
//先装git yum install git //git下扩展 cd /usr/local/src git clone https://github.com/phpredis/phpredis.git //安装扩展 cd phpredis phpize //修改php配置 vi /etc/php.ini 添加extension=redis.so //重启php service php-fpm restart
以上是centos7 yum安裝 php的方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

載CentOS-7.0-1406的時候,有很多可選則的版本,對於普通用戶來說,不知道選擇哪個好,下面做一下簡單介紹:(1)CentOS-xxxx-LiveCD.ios和CentOS-xxxx- bin-DVD.iso有什麼差別?前者只有700M,後者有3.8G。其差異不僅在大小上,其更本質的差異是,CentOS-xxxx-LiveCD.ios只能載入到記憶體裡運行,不能安裝。 CentOS-xxx-bin-DVD1.iso才可以安裝到硬碟上。 (2)CentOS-xxx-bin-DVD1.iso,Ce

因為需要用到C++11,但CentOS自備的gcc4.4.7不支持,所以決定升級gcc。操作如下:#備份mv/etc/yum.repos.d/devtools-2.repo/etc/yum.repos.d/devtools-2.repo.bakwgethttp://people.centos.org/tru/devtools-2 /devtools-2.repo-O/etc/yum.repos.d/devtools-2.repoyuminstalldevtoolset-2-gccdevtoolse

打開centos7頁面出現:welcometoemergencymode! afterloggingin,type“journalctl-xb”toviewsystemlogs,“systemctlreboot”toreboot,“systemctldefault”totryagaintobootintodefaultmode。 giverootpasswordformaintenance(??Control-D???):解決方法:執行r

centos7系統中tmp目錄下有很多垃圾,想要清除垃圾,該怎麼清除呢?下面我們就來看看詳細的教學。查看tmp檔案目錄下檔案列表,執行指令cdtmp/切換到tmp目前檔案目錄,執行ll指令,查看目前目錄下檔列表。如下圖所示。使用rm刪除檔案指令,需要注意的是rm指令是將檔案永遠從系統中刪除,因此建議在使用rm指令時,最好是在刪除檔案前給予提示。使用指令rm-i檔名,等用戶確認刪除(y)或跳過刪除(n),系統進行對應的操作。如下圖所示。

出於安全考慮設定密碼規則設定密碼到期的天數。使用者必須在天內更改密碼。此設定僅影響建立用戶,而不會影響現有用戶。如果設定為現有用戶,請執行指令「chage-M(days)(user)」。 PASS_MAX_DAYS60#密碼到期時間PASS_MIN_DAYS3#初始密碼更改時間PASS_MIN_LEN8#密碼最小長度PASS_WARN_AGE7#密碼過期提示時間重複密碼限制使用[root@linuxprobe~]#vi/etc/pam.d/system-auth#nearline15:

1.下載gitlab安裝包從【清華大學開源軟體鏡像站】下載最新中文版gitlab安裝包,安裝包裡自帶了簡體中文漢化包。從【gitlab官網】下載gitlab最新安裝包。 2.安裝gitlab以gitlab-ce-14.9.4-ce.0.el7.x86_64為例,上傳至centos伺服器使用yum安裝gitlabyum-yinstallgitlab-ce-14.3.2-ce.0.el7.x86_64. rpm使用yum安裝gityum-yinstallgit#安裝git修改gitlab設定檔vi

1.UncaughtError:Calltoundefinedfunctionmb_strlen();出現如上錯誤時,說明我們沒裝上mbstring擴展;2.進入PHP安裝目錄cd/temp001/php-7.1.0/ext/mbstring3.啟動phpize(/usr/local/bin /phpize或/usr/local/php7-abel001/bin/phpize)指令來安裝php擴充4../configure--with-php-config=/usr/local/php7-abel

centos7不帶mysql資料庫了,預設的資料庫是mariadb(mysql的一個分支)。可以依照以下步驟手動安裝mysql資料庫。 1.下載rpm安裝檔wgethttp://repo.mysql.com/mysql-community-release-el7.rpm2.執行rpm安裝rpm-ivhmysql-community-release-el7.rpm依賴解析完成後,出現下列選項:dependenciesresolved ===================================
