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 下安裝達夢7Redhat
- Centos7或RedHat7下安裝MysqlCentOSRedhatMySql
- redhat安裝dockerRedhatDocker
- CentOS7安裝php、安裝MySqlCentOSPHPMySql
- CentOS 7 安裝 PHP 7.2CentOSPHP
- CentOS 7 安裝PHP 5.4.16CentOSPHP
- centos7+安裝nginx+php7CentOSNginxPHP
- RedHat 7 靜默安裝Oracle11g的補充RedhatOracle
- Oracle:Redhat 7 + Oracle RAC 11g 安裝 bug 總結OracleRedhat
- CentOS 7 完全解除安裝PHPCentOSPHP
- PHP7 編譯安裝PHP編譯
- centos7下安裝phpCentOSPHP
- Linux(01):RedHat 7.6 安裝LinuxRedhat
- centOS(同redhat)安裝 dockerCentOSRedhatDocker
- docker學習7:Docker 安裝 PHPDockerPHP
- CentOS 7 yum 安裝 PHP7.3CentOSPHP
- 一鍵安裝PHP7.xPHP
- RedHat FC5安裝xmmsRedhat
- PostgreSQL:Redhat 8.5 + PostgreSQL 14.5 安裝SQLRedhat
- ubuntu16.04 PHP7安裝與Nginx PHPUbuntuPHPNginx
- Python 開發環境搭建(02):Python 3.7 + Redhat 7 原始碼安裝Python開發環境Redhat原始碼
- Cnetos7編譯安裝PHP教程。編譯PHP
- php7 安裝rabbitmq 擴充套件PHPMQ套件
- php7 安裝 imagick 擴充套件PHP套件
- centos7下安裝php8.0CentOSPHP
- RedHat 7.6作業系統安裝Redhat作業系統
- PHP7 原始碼安裝 swoole 全流程PHP原始碼
- redhat 5.4下安裝MYSQL全過程RedhatMySql
- CentOS7 yum 安裝 nginx 和 PHP7 訪問白屏CentOSNginxPHP
- CentOS7上安裝並配置Nginx、PHP、MySqlCentOSNginxPHPMySql
- CentOS 7 下安裝 nginx + PHP 執行環境CentOSNginxPHP
- php7安裝redis6擴充套件PHPRedis套件
- RedHat上靜默安裝Oracle11gRedhatOracle
- redhat7.2靜默安裝Oracle11.2.0.4RedhatOracle
- redhat7.6安裝Oracle11G RACRedhatOracle
- Centos安裝PHP7及配置php-fpm開機啟動CentOSPHP
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- linux 安裝yum 安裝phpLinuxPHP