1. 云栖社区>
  2. PHP教程>
  3. 正文

PHP安装备忘

作者:用户 来源:互联网 时间:2017-12-01 12:02:05

php安装

PHP安装备忘 - 摘要: 本文讲的是PHP安装备忘, ## Installation script## Prepare for compilation environmentyum install -y groupinstall"Development Tools"# Create a bu


#
# Installation script
#
# Prepare for compilation environment
yum install -y groupinstall"Development Tools"
# Create a build directory
mkdir -p /opt/install/php
# Prepare for compilation source
cd /opt/install/php
curl -o php-5.4.3.tar.gz http://cn2.php.net/distributions/php-5.4.3.tar.gz
tar -zxvf php-5.4.3.tar.gz
# Install build dependencies
yum install -y libxml2-devel
# Create a User Group
# Compile and deploy
cd php-5.4.3
./configure
--prefix=/opt/environment/php/5.4.3
--with-config-file-path=/opt/environment/php/5.4.3/etc
--with-apxs2=/opt/server/web/httpd/bin/apxs
--with-mysql=/opt/server/database/mysql
--with-mysqli=/opt/server/database/mysql/bin/mysql_config
--with-mysql-sock=/opt/server/database/mysql/tmp/mysql.sock
--with-pdo-mysql=/opt/server/database/mysql
make
make install
# Postinstallation setup
cp php.ini-production /opt/environment/php/5.4.3/etc/php.ini
# Configuration
/opt/server/web/httpd
sed -i -e"s/DirectoryIndex index.html/DirectoryIndex index.html index.php/"conf/httpd.conf
sed -i -e"s//nn
SetHandler application/x-httpd-phpn/"conf/httpd.conf
cat >htdocs/index.php<<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
eof
/etc/init.d/httpd restart
# Additional
/etc/init.d/httpd start
/etc/init.d/httpd stop

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索php , 安装 ,以便于您获取更多的相关知识。

弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率

40+云计算产品,6个月免费体验

稳定可靠、可弹性伸缩的在线数据库服务,全球最受欢迎的开源数据库之一

云服务器9.9元/月,大学必备