摘要:本文主要向大家介绍了PHP语言学习之PHP的安装,通过具体的内容向大家展示,希望对大家学习php语言有所帮助。
本文主要向大家介绍了PHP语言学习之PHP的安装,通过具体的内容向大家展示,希望对大家学习php语言有所帮助。
1、PHP5的安装:
下载:
wget -c //cn2.php.net/distributions/php-5.6.36.tar.gz (php5)
wget -c //cn2.php.net/distributions/php-7.2.5.tar.gz (php7)
解压:
tar -xvf php-5.6.36.tar.gz
tar -xvf php-7.2.5.tar.gz
进入到解压后的目录里面去:
cd php-5.6.36
安装:
./configure --prefix=/usr/local/php56 --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql56 --with-pdo-mysql=/usr/local/mysql56 --with-mysqli=/usr/local/mysql56/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
若出现这些报错:
yum install bzip2-devel.x86_64 -y
yum install openssl-devel.x86_64 -y
yum install libxml2-devel.x86_64 -y
yum install libjpeg-turbo-devel.x86_64 libjpeg-turbo.x86_64 -y
yum install libpng-devel.x86_64 libpng.x86_64 libpng12.x86_64 libpng12-devel.x86_64 -y
yum install freetype-devel.x86_64 -y
yum install libmcrypt.x86_64 libmcrypt-devel.x86_64 -y
make && make install 编译并安装。
查看PHP 所加载的模块:
/usr/local/php56/bin/php -m
查看apache 所加载的模块:
因为php做为apache的一个模块而调用的,所以,想看php启动成功没,就看apache是否有调用。
/usr/local/apache2.4/bin/apachectl -M
查看apache配制文件中是否有加载PHP模块:
cat /usr/local/apache2.4/conf/httpd.conf |grep -i PHP
互此php5模块,安装成功!
2、PHP7的安装:
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标编程语言PHP频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号