yum如何安裝php環境(php編譯安裝和yum安裝有什麼區別)

本文目錄一覽:

伺服器上怎麼安裝php程序

你好,如果你的伺服器是Windows系統,那麼你需要遠程到你的伺服器,進行啟動IIS(asp環境),如果你需要php環境,你可以從xp.cn(小皮)或者bt.cn(寶塔)安裝面板

如果你的伺服器是Linux,建議使用寶塔

打開終端,不同Linux系統的輸入指令不同:

Centos安裝腳本

終端輸入:yum install -y wget wget -O install.sh sh install.sh

Ubuntu/Deepin安裝腳本

終端輸入:wget -O install.sh sudo bash install.sh

Debian安裝腳本

終端輸入:wget -O install.sh bash install.sh

Fedora安裝腳本

終端輸入wget -O install.sh bash install.sh

輸入後進行安裝就可以了

阿里雲上的centos 7.2怎麼yum安裝php 5.6

因之前通過網易的 centos 鏡像,將阿里雲的 centos 升級到最新版了,乘自己的項目尚未開始正式開發,遂將所有的相應環境都升級到最高。

查看 centos 版本:

[root@iZ23d ~]# cat /etc/centos-release

CentOS Linux release 7.2.1511 (Core)

1、刪除之前的 php 版本:

[root@iZ23d ~]# yum remove php* php-common

Loaded plugins: langpacks

Repository base is listed more than once in the configuration

Repository updates is listed more than once in the configuration

Repository extras is listed more than once in the configuration

Repository centosplus is listed more than once in the configuration

No Match for argument: php-5.4.16

No Match for argument: php-5.4.16.tar.gz

No Match for argument: php-7.0.1RC1

No Match for argument: php-7.0.1RC1.tar.gz

No Match for argument: phpMyAdmin-4.4.0.tar.gz

No Match for argument: php-common

No Packages marked for removal

2、rpm 安裝 Php7 相應的 yum源:

[root@iZ23d ~]# rpm -Uvh

Retrieving

warning: /var/tmp/rpm-tmp.LhJKKR: Header V4 RSA/SHA1 Signature, key ID 62e74ca5: NOKEY

Preparing… ################################# [100%]

package webtatic-release-7-3.noarch is already installed

3、 直接yum安裝php7:

[root@iZ23d ~]# yum install php70w

Loaded plugins: langpacks

Repository base is listed more than once in the configuration

Repository updates is listed more than once in the configuration

Repository extras is listed more than once in the configuration

Repository centosplus is listed more than once in the configuration

Resolving Dependencies

— Running transaction check

。。。 【省略】

Warning: RPMDB altered outside of yum.

Installing : php70w-common-7.0.0-1.w7.x86_64 1/3

Installing : php70w-cli-7.0.0-1.w7.x86_64 2/3

Installing : php70w-7.0.0-1.w7.x86_64 3/3

Verifying : php70w-7.0.0-1.w7.x86_64 1/3

Verifying : php70w-common-7.0.0-1.w7.x86_64 2/3

Verifying : php70w-cli-7.0.0-1.w7.x86_64 3/3

Installed:

php70w.x86_64 0:7.0.0-1.w7

Dependency Installed:

php70w-cli.x86_64 0:7.0.0-1.w7 php70w-common.x86_64 0:7.0.0-1.w7

Complete!

4、檢查 php 版本:

[root@iZ23d ~]# php -v

PHP 7.0.0 (cli) (built: Dec 2 2015 20:42:32) ( NTS )

Copyright (c) 1997-2015 The PHP Group

Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

[root@iZ23d2e6hoqZ ~]#

以上顯示安裝成功!

5、重啟 Apache,查看 phpinfo :

[root@iZ23d ~]# systemctl restart httpd.service

檢查phpinfo:

PHP Version 7.0.0

SystemLinux iZ23d 3.10.0-229.11.1.el7.x86_64 #1 SMP Thu Aug 6 01:06:18 UTC 2015 x86_64

Build DateDec 2 2015 20:43:38

Server APIApache 2.0 Handler

Virtual Directory Supportdisabled

Configuration File (php.ini) Path/etc

Loaded Configuration File/etc/php.ini

Scan this dir for additional .ini files/etc/php.d

Additional .ini files parsed/etc/php.d/bz2.ini, /etc/php.d/calendar.ini, /etc/php.d/ctype.ini, /etc/php.d/curl.ini, /etc/php.d/exif.ini, /etc/php.d/fileinfo.ini, /etc/php.d/, /etc/php.d/gettext.ini, /etc/php.d/gmp.ini, /etc/php.d/iconv.ini, /etc/php.d/json.ini, /etc/php.d/phar.ini, /etc/php.d/shmop.ini, /etc/php.d/simplexml.ini, /etc/php.d/sockets.ini, /etc/php.d/tokenizer.ini, /etc/php.d/xml.ini, /etc/php.d/zip.ini

PHP API20151012

PHP Extension20151012

Zend Extension320151012

Zend Extension BuildAPI320151012,NTS

PHP Extension BuildAPI20151012,NTS

Debug Buildno

Thread Safetydisabled

Zend Signal Handlingdisabled

Zend Memory Managerenabled

Zend Multibyte Supportdisabled

IPv6 Supportenabled

DTrace Supportenabled

Registered PHP Streamshttps, ftps, compress.zlib, php, file, glob, data, http, ftp, compress.bzip2, phar, zip

Registered Stream Socket Transportstcp, udp, unix, udg, ssl, sslv3, sslv2, tls, tlsv1.0, tlsv1.1, tlsv1.2

Registered Stream Filterszlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, bzip2.*, convert.iconv.*

This program makes use of the Zend Scripting Language Engine:

Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

Configuration

apache2handler

Apache VersionApache/2.4.6 (CentOS)

Apache API Version20120211

Server Administratorxxxxxx@xxxxxx.com

Hostname:Portxxxx.xxxxx.xxx:0

User/Groupapache(48)/48

Max RequestsPer Child: 0 – Keep Alive: on – Max Per Connection: 100

TimeoutsConnection: 60 – Keep-Alive: 15

Virtual ServerYes

Server Root/etc/httpd

Loaded Modulescore mod_so http_core mod_access_compat mod_actions mod_alias mod_allowmethods mod_auth_basic mod_auth_digest mod_authn_anon mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authn_socache mod_authz_core mod_authz_dbd mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_owner mod_authz_user mod_autoindex mod_cache mod_cache_disk mod_data mod_dbd mod_deflate mod_dir mod_dumpio mod_echo mod_env mod_expires mod_ext_filter mod_filter mod_headers mod_include mod_info mod_log_config mod_logio mod_mime_magic mod_mime mod_negotiation mod_remoteip mod_reqtimeout mod_rewrite mod_setenvif mod_slotmem_plain mod_slotmem_shm mod_socache_dbm mod_socache_memcache mod_socache_shmcb mod_status mod_substitute mod_suexec mod_unique_id mod_unixd mod_userdir mod_version mod_vhost_alias mod_dav mod_dav_fs mod_dav_lock mod_lua prefork mod_proxy mod_lbmethod_bybusyness mod_lbmethod_byrequests mod_lbmethod_bytraffic mod_lbmethod_heartbeat mod_proxy_ajp mod_proxy_balancer mod_proxy_connect mod_proxy_express mod_proxy_fcgi mod_proxy_fdpass mod_proxy_ftp mod_proxy_http mod_proxy_scgi mod_proxy_wstunnel mod_ssl mod_systemd mod_cgi mod_perl mod_php7

以上顯示 php7 安裝成功!

centos 下如何通過yum安裝最新的php

remi源,這裡的php版本較新,5.4,5.5,5.6都有,還有配套的各種擴展

rpms.famillecollet.com

 

Centos 6.默認下沒有安裝php組件,因此我們需要輸入命令:yum -y install php 回車如下圖。

不用管,程序會自動完成安裝及配置。

Zend組件,Centos 6.3 裡面是沒有的,需要手動下載,及安裝教程請點擊下面鏈接:

到此前期的準備工作已完成,下面就要對Apache進行配置

輸入命令 pd/conf/httpd.conf //打開Apache配置文件,

找到ServerTokens OS 將「OS」改為「Prod 「 。//顯示伺服器運行錯誤信息。與下圖一樣,那麼Apache你就配置成功了,如果不一樣請仔細對比上面的教程是不是那個步驟少了#及字母拼寫錯了。

到此php運行環境便配置成功啦。

 

centos6.6下怎麼用yum安裝php

是一個在Fedora和RedHat以及SUSE中的Shell前端軟體包管理器。可以自動處理依賴性關係,並且一次安裝所有依賴的軟體包,無須繁瑣地一次次下載、安裝。使用yum安裝PHP的前提準備:

1、yum update 檢查一下系統更新 初次安裝可能更新的時間會比較長,請耐心等待。

2、yum install gcc gcc-c++ ;安裝gcc軟體編譯環境。

[root@lamp ~]# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml

安裝好php之後重啟httpd : /etc/init.d/httpd restart

設置成開機啟動:

chkconfig httpd on

chkconfig mysqld on

整個過程我們不需要修改/etc/httpd/conf/httpd.conf 這就是版本高了的好處~

原創文章,作者:PWNQ7,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/128100.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
PWNQ7的頭像PWNQ7
上一篇 2024-10-03 23:24
下一篇 2024-10-03 23:24

相關推薦

  • PHP和Python哪個好找工作?

    PHP和Python都是非常流行的編程語言,它們被廣泛應用於不同領域的開發中。但是,在考慮擇業方向的時候,很多人都會有一個問題:PHP和Python哪個好找工作?這篇文章將從多個方…

    編程 2025-04-29
  • Python正則表達式search()和match()有什麼區別?

    search()和match()都是Python中的正則表達式函數,它們的作用都是在一個字元串中搜索匹配正則表達式的位置,但它們有著不同的使用場景和返回結果。 一、search()…

    編程 2025-04-29
  • 如何部署一個服務到一個環境

    本文將從多個方面對如何部署一個服務到一個環境進行詳細的闡述,包括環境準備、代碼編寫、打包部署等。 一、環境準備 1、確定部署環境的操作系統版本、運行時環境(如JDK、Node.js…

    編程 2025-04-29
  • Python開發環境包括

    Python作為一門高效、易讀易學的語言,已經被越來越多的開發者使用。而Python的開發環境也發展得越來越完善。本文將會從以下幾個方面對Python開發環境包括做詳細的闡述: 一…

    編程 2025-04-29
  • PHP怎麼接幣

    想要在自己的網站或應用中接受比特幣等加密貨幣的支付,就需要對該加密貨幣擁有一定的了解,並使用對應的API進行開發。本文將從多個方面詳細闡述如何使用PHP接受加密貨幣的支付。 一、環…

    編程 2025-04-29
  • 內核驅動編譯環境代價分析

    內核驅動編譯環境是在Linux系統中編譯內核模塊的過程。本文通過分析內核驅動編譯環境的各個方面,包括編譯工具的選擇、編譯速度、編譯器選項等,來探討其代價所在,並提供一些優化的建議。…

    編程 2025-04-29
  • 如何使用cmd激活python虛擬環境

    Python虛擬環境是Python用來隔離項目所需包和依賴庫的工具,以免不同項目之間的依賴關係衝突。下面將從安裝虛擬環境、創建虛擬環境、激活虛擬環境這3個方面來詳細講解如何在cmd…

    編程 2025-04-28
  • 如何使用yum安裝curl、policycoreutils、policycoreutils-python-utils和openssh-server等軟體包

    yum是一個常用的包管理器,可以使在Linux系統上安裝、更新和卸載軟體包變得更加容易。本文將詳細介紹使用yum安裝curl、policycoreutils、policycoreu…

    編程 2025-04-28
  • 使用PHP foreach遍歷有相同屬性的值

    本篇文章將介紹如何使用PHP foreach遍歷具有相同屬性的值,並給出相應的代碼示例。 一、基礎概念 在講解如何使用PHP foreach遍歷有相同屬性的值之前,我們需要先了解幾…

    編程 2025-04-28
  • Apache配置Python環境

    Apache是一款流行的Web伺服器軟體,事實上,很多時候我們需要在Web伺服器上使用Python程序做為數據處理和前端網頁開發語言,這時候,我們就需要在Apache中配置Pyth…

    編程 2025-04-28

發表回復

登錄後才能評論