PHP安装备忘_PHP_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > PHP > PHP安装备忘

PHP安装备忘

 2012/6/1 16:45:08  fly2wind  程序员俱乐部  我要评论(0)
  • 摘要:##Installationscript##Prepareforcompilationenvironmentyuminstall-ygroupinstall"DevelopmentTools"#Createabuilddirectorymkdir-p/opt/install/php#Prepareforcompilationsourcecd/opt/install/phpcurl-ophp-5.4.3.tar.gzhttp://cn2.php.net/distributions/php-5.4
  • 标签:PHP 安装
#
# 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
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/<\/Files>/<\/Files>\n<FilesMatch \\\.php$>\n SetHandler application\/x-httpd-php\n<\/FilesMatch>/" conf/httpd.conf
cat >htdocs/index.php<<eof
<?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
发表评论
用户名: 匿名