首頁 後端開發 php教程 linux下如何安裝Php

linux下如何安裝Php

May 15, 2018 pm 03:06 PM
linux php 安裝

這篇文章主要介紹如何在linux下如何安裝PHP,有興趣的朋友參考下,希望對大家有幫助。

Linux 安裝php-5.4.5

#1. 下載php-5.4.5.tar.gz

#2. 解壓縮

[root@test31~] tar -zxvf php-5.4.5.tar.gz

3. 進入安裝文件目錄

[root@test31~] cd php-5.4.5

4. 執行

[root@test31 php-5.4 .5]# ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql

注意:綠色標記為你apache的安裝目錄

#出現問題:

##"

configure: error: xml2-config not found. Please check your libxml2 installation."

##檢查是否安裝了libxm套件

#[root@test31 php-5.4.5]# rpm -qa |grep  libxml2

libxml2-2.6.26-2.1.12

libxml2-python-2.6.26-2.1.12
##libxml2-python-2.6.26-2.1.12
##libxml2-python-2.6.26-2.1.12

#重新安裝libxml2和libxml2-devel套件

yum install libxml2

yum install libxml2-devel -y (安裝這個)

#安裝完後再找xml2-config檔是否存在

[root@test31 php-5.4.5]#  find / -name "xml2-config"
/usr/bin/xml2- config

如果存在的話重新安裝php

#[root@test31 php-5.4.5]# ./configure --prefix=/ usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql

執行如果報錯:  「Cannot find MySQL header files under yes

需要指定mysql的安裝路徑

[root@test31 php-5.4.5]# ./configure --prefix=/ usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql

#安裝成功的標誌是:

出現

# ------------ -------------------------------------------------- ------
| License:                                   |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process | , you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this license, you must abort |
| the installation process at this license, you must abort         |

-- -------------------------------------------------- ------------------

Thank you for using PHP.

 相關推薦:

最詳細的linux安裝php流程

linux安裝php 模組--with-mysql --with-mysqli非得需要安裝mysql嗎

Linux安裝php報錯記錄

###

以上是linux下如何安裝Php的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章

兩個點博物館:邦格荒地地點指南
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章

兩個點博物館:邦格荒地地點指南
4 週前 By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章標籤

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

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

適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南 適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南 Dec 24, 2024 pm 04:42 PM

適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南

deepseek網頁版入口 deepseek官網入口 deepseek網頁版入口 deepseek官網入口 Feb 19, 2025 pm 04:54 PM

deepseek網頁版入口 deepseek官網入口

deepseek怎麼安裝 deepseek怎麼安裝 Feb 19, 2025 pm 05:48 PM

deepseek怎麼安裝

如何設定 Visual Studio Code (VS Code) 進行 PHP 開發 如何設定 Visual Studio Code (VS Code) 進行 PHP 開發 Dec 20, 2024 am 11:31 AM

如何設定 Visual Studio Code (VS Code) 進行 PHP 開發

php程序在字符串中計數元音 php程序在字符串中計數元音 Feb 07, 2025 pm 12:12 PM

php程序在字符串中計數元音

BITGet官方網站安裝(2025新手指南) BITGet官方網站安裝(2025新手指南) Feb 21, 2025 pm 08:42 PM

BITGet官方網站安裝(2025新手指南)

您如何在PHP中解析和處理HTML/XML? 您如何在PHP中解析和處理HTML/XML? Feb 07, 2025 am 11:57 AM

您如何在PHP中解析和處理HTML/XML?

歐易okx安裝包直接進 歐易okx安裝包直接進 Feb 21, 2025 pm 08:00 PM

歐易okx安裝包直接進

See all articles