RedHat 7 安裝PHP
1.作業系統版本
2.下載php安裝包,本例是5.6.30版本
3.解壓
4.執行configure
5.在configure過程中遇到6個錯誤,如下:
其中錯誤6,需要安裝epel擴充套件yum源,安裝方法如下:
6.上面的錯誤都解決後就可以編譯和安裝了
7.最後複製檔案
8.測試是否正確解析php
9.儲存指令碼後繼續測試,如下:
10.檢視PHP配置檔案所在位置
歡迎訪問我的另一篇文章,RedHat 7 安裝httpd
http://blog.itpub.net/20893244/viewspace-2151184/
-
[root@aws srclib]# cat /etc/redhat-release
- Red Hat Enterprise Linux Server release 7.4 (Maipo)
-
cd /usr/local/src
- wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
- tar -xzvf 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-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
-
錯誤1:
configure: error: xml2-config not found. Please check your libxml2 installation.
解決辦法:
yum install -y libxml2-devel
錯誤2:
configure: error: Cannot find OpenSSL's
解決辦法:
yum install -y openssl openssl-devel
錯誤3:
configure: error: Please reinstall the BZip2 distribution
解決辦法:
yum install -y bzip2 bzip2-devel
錯誤4:
configure: error: jpeglib.h not found.
解決辦法:
yum install -y libjpeg libjpeg-devel
錯誤5:
configure: error: freetype-config not found.
解決辦法:
yum install -y freetype freetype-devel
錯誤6:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解決辦法:
yum install -y libmcrypt-devel
- rpm -ivh ""
-
make
- make install
- cp php.ini-production /usr/local/php/etc/php.ini
8.測試是否正確解析php
-
vi /usr/local/apache2.4/htdocs/mytest.php //寫入如下內容
-
<?php
-
-
echo "php測試正常"
- ?>
9.儲存指令碼後繼續測試,如下:
-
[root@aws srclib]# curl localhost/mytest.php
-
-
-
- php測試正常
-
[root@aws srclib]# /usr/local/php/bin/php -i |grep -i "loaded configuration file"
- PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC
http://blog.itpub.net/20893244/viewspace-2151184/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20893244/viewspace-2151185/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RedHat 7 安裝HTTPDRedhathttpd
- Redhat 7 下安裝達夢7Redhat
- Centos7或RedHat7下安裝MysqlCentOSRedhatMySql
- CentOS7安裝php、安裝MySqlCentOSPHPMySql
- CentOS 7 安裝 PHP 7.2CentOSPHP
- PHP7 安裝 xhprofPHP
- RedHat 7 靜默安裝Oracle11gRedhatOracle
- centos7+安裝nginx+php7CentOSNginxPHP
- PHP7 編譯安裝PHP編譯
- centos7下安裝phpCentOSPHP
- CentOS 7 完全解除安裝PHPCentOSPHP
- CentOS 7 安裝PHP 5.4.16CentOSPHP
- 編譯安裝php7編譯PHP
- php7編譯安裝PHP編譯
- [LAMP]安裝PHP5/7LAMPPHP
- redhat安裝dockerRedhatDocker
- centos7原始碼安裝php7CentOS原始碼PHP
- CentOS 7 yum 安裝 PHP7.3CentOSPHP
- 一鍵安裝PHP7.xPHP
- docker學習7:Docker 安裝 PHPDockerPHP
- win7安裝apache+phpWin7ApachePHP
- OSX下安裝PHP7教程PHP
- RedHat 7.4安裝DockerRedhatDocker
- RedHat 6 桌面安裝Redhat
- Oracle:Redhat 7 + Oracle RAC 11g 安裝 bug 總結OracleRedhat
- RedHat 7 靜默安裝Oracle11g的補充RedhatOracle
- php7 安裝rabbitmq 擴充套件PHPMQ套件
- centos7下安裝php8.0CentOSPHP
- php7 安裝 imagick 擴充套件PHP套件
- PHP7安裝配置(win10)PHPWin10
- Centos7Nginx+PHP安裝步驟CentOSNginxPHP
- Centeros 6 安裝 php7 apache mysqlROSPHPApacheMySql
- ubuntu16.04 PHP7安裝與Nginx PHPUbuntuPHPNginx
- centos7 安裝php7+mysql5.7+nginx+redisCentOSPHPMySqlNginxRedis
- 在RedHat Linux 7.3下安裝Apache + PHP + Mysql + JDK + Resin (轉)RedhatLinuxApachePHPMySqlJDK
- centOS(同redhat)安裝 dockerCentOSRedhatDocker
- Redhat 5 上安裝yumRedhat
- redhat6安裝flashplayerRedhat