原环境为Apache-tomcat-7.0,现在需要支持php
先装一个扩展
tar -zxf libiconv-1.14.tar.gz
cd
libiconv-1.14
./configure
--prefix=/usr/local/libiconv
make && make install
编译php
./configure
--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc
--with-openssl --enable-cli --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd
--with-iconv=/usr/local/libiconv --with-freetype-dir --enable-maintainer-zts
--with-zlib --enable-xml --enable-rpath --enable-bcmath --enable-shmop
--enable-sysvsem --enable-inline-optimization --with-curl --enable-exif
--enable-mbregex --enable-fpm --enable-mbstring
--with-gd --enable-gd-native-ttf --with-mhash --enable-pcntl
--enable-sockets --with-xmlrpc --enable-zip --enable-soap
--with-mcrypt=/usr/local --enable-force-cgi-redirect --enable-cgi &&
make ZEND_EXTRA_LIBS='-liconv' && make install
修改Tomcat配置
Web.xml
php
org.apache.catalina.servlets.CGIServlet
clientInputTimeout
200
debug
0
executable
/usr/local/php/bin/php-cgi
passShellEnvironment
true
cgiPathPrefix
/
5
php
*.php
index.html
index.htm
index.jsp
index.php