php5安裝
PHP官網www.php.net
當前主流版本為5.6/7.1
cd /usr/local/src/
wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
tar zxf php-5.6.30.tar.gz
cd php-5.6.30
./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2.4/bin/apxs –with-config-file-path=/usr/local/php/etc –with-mysql=/usr/local/mysql –with-pdo-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config –with-libxml-dir –with-gd –with-jpeg-dir –with-png-dir –with-freetype-dir –with-iconv-dir –with-zlib-dir –with-bz2 –with-openssl –with-mcrypt –enable-soap –enable-gd-native-ttf –enable-mbstring –enable-sockets –enable-exif
–prefix= 指定安裝目錄 –with-apxs2=Apache的工具,不需要人工的干涉,自動的把擴充套件模組放到modules模組裡,並且在配置檔案里加一行loadmoduls,能夠httpd -M的時候把模組載入出來。所以要先安裝Apache,要指定這個工具地址
make && make install
cp php.ini-production /usr/local/php/etc/php.ini //配置檔案路徑/usr/local/php/etc因為這下面是空的(開發環境可使用php.ini-development)
/usr/local/php/bin/php -i|less //檢視php相關資訊
Loaded Configuration File => /usr/local/php/etc/php.ini
ls /usr/local/php/bin/ //php核心二進位制檔案
pear peardev pecl phar phar.phar php php-cgi php-config phpize
du -sh /usr/local/apache2.4/modules/libphp5.so //php擴充套件模組。Apache需要
37M /usr/local/apache2.4/modules/libphp5.so
/usr/local/php/bin/php -m //檢視載入的模組有哪些(顯示靜態檔案,也可動態擴充套件模組安裝)
[root@lsx-001 php-5.5.38]# du -sh /usr/local/php
77M /usr/local/php
[root@lsx-001 php-5.5.38]# du -sh /usr/local/apache2/modules/libphp5.so
35M /usr/local/apache2/modules/libphp5.so Apache結合php依賴libphp5
[root@lsx-001 php-5.5.38]# /usr/local/php/bin/php –m 檢視載入的模組(靜態的)
[PHP Modules]
bz2
Core
ctype
date
Apache配置檔案
[root@lsx-001 php-5.5.38]# vi /usr/local/apache2/conf/httpd.conf
錯誤:
1.error: xml2-config not found. Please check your libxml2 installation.
解決辦法:
yum list|grep libxml2
yum install -y libxml2-devel.x86_64
2.error: Cannot find OpenSSL`s <evp.h>
yum list|grep OpenSSL -i
yum install -y openssl-devel.x86_64
3.error: Please reinstall the BZip2 distribution
yum install -y bzip2-devel.x86_64
4.error: jpeglib.h not found.
yum install -y libjpeg-turbo-devel.x86_64
5.error: png.h not found.
yum install -y libpng-devel.x86_64
6.error: freetype-config not found.
yum install -y freetype-devel.x86_64
7.error: mcrypt.h not found. Please reinstall libmcrypt.
yum install -y epel-release
yum install -y libmcrypt-devel
本文轉自 蝦米的春天 51CTO部落格,原文連結:http://blog.51cto.com/lsxme/2051885,如需轉載請自行聯絡原作者
相關文章
- Ubuntu php5安裝UbuntuPHP
- [LAMP]安裝PHP5/7LAMPPHP
- php5安裝後phpinfo顯示空白PHP
- Ubuntu Linux下為PHP5安裝cURLUbuntuLinuxPHP
- 如何在DebianStretch中安裝使用PHP5PHP
- centos5安裝PHP5時遇到問題CentOSPHP
- Ubuntu16.04 php5安裝失敗解決方案UbuntuPHP
- PHP5的OOP–$this引用PHPOOP
- codis安裝 (java 安裝 + zookeeper 安裝 + go 安裝 + codis 安裝JavaGo
- 安裝npm 解除安裝npm 安裝apidocNPMAPI
- mysql安裝 (yum 安裝)MySql
- MMM安裝、MHA安裝
- PHP5下單獨編譯php模組PHP編譯
- php5學習系列筆記(連載)PHP筆記
- mysql安裝------RPM包安裝及解除安裝MySql
- oracle安裝:OUI安裝Oracle(圖形介面安裝)OracleUI
- ffmpeg安裝之mac安裝Mac
- docker安裝及解除安裝Docker
- 02 安裝git、安裝TortoiseGitGit
- Ubuntu解除安裝和安裝Ubuntu
- Orace RAC安裝-DNS安裝DNS
- caffe安裝系列——安裝OpenCVOpenCV
- SPARK 安裝之scala 安裝Spark
- mac 安裝opencv homebrew安裝MacOpenCV
- Oracle 安裝與解除安裝Oracle
- solaris mysql 安裝 解除安裝MySql
- BiocManager安裝,devtools安裝dev
- JDK安裝和解除安裝JDK
- 安裝HomeBrew提示已安裝並無法解除安裝
- SQL Server 2012 安裝——安裝 OR 解除安裝SQLServer
- win10安裝版怎麼安裝_安裝版win10安裝教程Win10
- PHP5中PDO(PHPDATAOBJECT)模組基礎詳解PHPObject
- PHP5物件導向 OOP思維導圖PHP物件OOP
- PHP5 SOAP呼叫原理及實現過程PHP
- php5模組pdo、pdo_mysql、mysqli的新增PHPMySql
- mysql安裝-----二進位制包安裝及解除安裝MySql
- cocoapods安裝/解除安裝/使用
- Mac Redis安裝與解除安裝MacRedis