from http://blog.csdn.net/yincg/article/details/8782364

1.1 系统说明
Centos 6.2 (最小化安装)
1.2 软件说明
httpd-2.4.2.tar.gz
apr-util-1.4.1.tar.gz
apr-1.4.6.tar.gz
pcre-8.13.tar.gz
php-5.4.3.tar.bz2
libmcrypt-2.5.8.tar.gz
mhash-0.9.9.9.tar.gz
第2章  Apache搭建说明
2.1 安装依赖包
yum install make openldap-devel ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf bzip2-devel ncurses-devel openssl-devel libtool*  zlib-devel libxml2-devel libjpeg-devel libpng-devel libtiff-devel fontconfig-devel freetype-devel libXpm-devel gettext-devel curl-devel curl pam-devel  openldap-devel e2fsprogs-devel krb5-devel libidn libidn-devel -y
2.2 安装apr
tar -zxvf apr-1.4.2.tar.gz
 cd apr-1.4.2.tar.gz
 ./configure  --prefix=/usr/local/apr
make  && make install
2.3 安装apr-util
tar -zxvf apr-util-1.3.10.tar.gz
cd apr-util-1.3.10.tar.gz
 ./configure \
--prefix=/usr/local/apr-util \
--with-apr=/usr/local/apr
 make && make install
2.4 安装pcre
tar -zxvf pcre-8.10.tar.gz
cd pcre-8.10
./configure --prefix=/usr/local/pcre
make && make install
2.5 安装apache
./configure \
--prefix=/usr/local/apache \
--with-apr-util=/usr/local/apr-util/ \
--with-pcre=/usr/local/pcre/ \
--with-apr=/usr/local/apr/
make && make install
2.6 配置文件说明
/usr/local/apache/conf/httpd.conf
DocumentRoot "/usr/local/apache/htdocs"
修改此条可配置项目运行目录。
启动文件
/usr/local/apache/bin/apachectl
第3章  Php搭建说明
3.1 安装libmcrypt
tar xvf libmcrypt-2.5.8.tar.gz
./configure
make && make install
3.2 安装mhash
tar xvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure 
make && make install
3.3 安装php
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php/etc 
make && make install 
cp php.ini-production /usr/local/php/etc/php.ini
3.4 错误提示修改说明
configure: error: Cannot find ldap libraries in /usr/lib
ln -s /usr/lib64/libldap* /usr/lib/
configure: error: libjpeg.(a|so) not found.
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
configure: error: libpng.(a|so) not found.
ln -s /usr/lib64/libpng.so /usr/lib/
第4章  修改配置并测试
4.1 修改apache配置文件支持php
修改DirectoryIndex index.html 为DirectoryIndex index.html index.php
并添加AddType application/x-httpd-php .php
4.2 测试php支持
创建测试php页面test.php,并存放在网站主目录下,
<?php
phpinfo();
?>
重启apache服务后,访问http://ip/test.php
看到站点,则说明php搭建完成;

2,example

<!DOCTYPE HTML> 
<html>
<head>
</head>
<body>

<?php
// define variables and set to empty values
$name = $email = $gender = $comment = $website = "";

if ($_SERVER["REQUEST_METHOD"] == "POST")
{
   $name = test_input($_POST["name"]);
   $email = test_input($_POST["email"]);
   $website = test_input($_POST["website"]);
   $comment = test_input($_POST["comment"]);
   $gender = test_input($_POST["gender"]);
}

function test_input($data)
{
   $data = trim($data);
   $data = stripslashes($data);
   $data = htmlspecialchars($data);
   return $data;
}
?>

<h2>PHP Form Validation Example</h2>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> 
   Name: <input type="text" name="name">
   <br><br>
   E-mail: <input type="text" name="email">
   <br><br>
   Website: <input type="text" name="website">
   <br><br>
   Comment: <textarea name="comment" rows="5" cols="40"></textarea>
   <br><br>
   Gender:
   <input type="radio" name="gender" value="female">Female
   <input type="radio" name="gender" value="male">Male
   <br><br>
   <input type="submit" name="submit" value="Submit"> 
</form>

<?php
echo "<h2>Your Input:</h2>";
echo $name;
echo "<br>";
echo $email;
echo "<br>";
echo $website;
echo "<br>";
echo $comment;
echo "<br>";
echo $gender;
?>

</body>
</html>

apache php env build的更多相关文章

  1. What is the difference Apache (Http Server) and Tomcat (Servlet Container)

    The Apache Project The Apache Project is a collaborative software development effort. Its goal is to ...

  2. Apache 流媒体 拖动模块编译

    Windows使用apxs独立编译 Apache 模块 http://blog.sina.com.cn/s/blog_43b83d340100mdhl.html 安装 apxs 1.解压apxs.zi ...

  3. apache atlas源码编译打包 centos

    参考:https://atlas.apache.org/InstallationSteps.html https://blog.csdn.net/lingbo229/article/details/8 ...

  4. kafka-rest:怎么愉快的build?

    愉快的build该项目吧 git clone https://github.com/confluentinc/kafka-restmvn clean install -Dmaven.test.skip ...

  5. (一)apache atlas源代码编译与打包

    特别注意: atlas已经提供了0.8版本可以安装了,只有在国外的服务器上安装编译才比较顺利,可以按照官方文档去安装. 国内很多网址有被墙的问题,目前还没有完全解决,可能安装不成功 安装文档地址:ht ...

  6. 【大数据系列】apache hive 官方文档翻译

    GettingStarted 开始 Created by Confluence Administrator, last modified by Lefty Leverenz on Jun 15, 20 ...

  7. C语言-apache mod(模块开发)-采用VS2017开发实战(windows篇)

    C语言-apache mod(模块开发)-采用VS2017开发实战(windows篇) 名词解释:apxs apxs is a tool for building and installing ext ...

  8. tomcat:run和tomcat7:run的区别,以及Apache Tomcat Maven Plugin 相关

    起因: 同事部署的maven项目,之前使用 jetty,现在切换到 tomcat,但是他使用的命令是 tomcat:run ,而不是 tomcat7:run,能启动,但出现问题了. 于是搜索了一番,想 ...

  9. @vue/cli3+配置build命令构建测试包&正式包

    上一篇博客介绍了vue-cli2.x配置build命令构建测试包和正式包,但现在前端开发vue项目大多数使用新版@vue/cli脚手架搭建vue项目(vue create project-name) ...

随机推荐

  1. 洛谷 P1546 最短网络 Agri-Net Label:Water最小生成树

    题目背景 农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立起互联网,并连接到所有的农场.当然,他需要你的帮助. 题目描述 约翰已经给他的农场安排了一条高速的网络线路,他想把这条线路共享给其 ...

  2. jS事件:target与currentTarget区别

    target在事件流的目标阶段:currentTarget在事件流的捕获,目标及冒泡阶段.只有当事件流处在目标阶段的时候,两个的指向才是一样的, 而当处于捕获和冒泡阶段的时候,target指向被单击的 ...

  3. 10秒钟安装 Vim编辑器,5分钟浏览常用命令 2015.10.25

    首先我想说,vim与vi的命令几乎相同,,所以学习编辑命令时很轻松,排除扩展相关,以及自动补全等配置的使用在外30秒钟安装 Vim编辑器,5分钟浏览常用命令环境:虚拟机Ubuntu:安装vim并浏览命 ...

  4. BZOJ 1054 题解

    1054: [HAOI2008]移动玩具 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1888  Solved: 1035[Submit][Stat ...

  5. LINQ to Entities 事务简单例子

    默认LINQ to Entities会使用隐式事务,即:对于每一个savechanges都分开在单独的事务之中. 也可以显式地指定事务: using (var db = new TestEntitie ...

  6. C#后台如何获取客户端访问系统型号

    ASP.NET获取客户端.服务器端基础信息 . 在ASP.NET中专用属性: 获取服务器电脑名:Page.Server.ManchineName 获取用户信息:Page.User 获取客户端电脑名:P ...

  7. 用脚本来简化iOS美术同学的工作

    用脚本来简化iOS美术同学的工作 问题 我们知道,在 iOS 开发中,为了使我们的 app 能够同时支持 iPhone 的 Retina 屏幕和普通屏幕,美术同学需要对 UI 设计稿中的每个元素进行 ...

  8. LaTeX算法排版

    需要包含的 \usepackage[noend]{algpseudocode} \usepackage{algorithmicx,algorithm} 源码 \begin{algorithm}[t]\ ...

  9. 2_STL容器

    STL算法的精髓在于  算法的  返回值!!! String: string是STL的字符串类型,通常用来表示字符串:C语言中一般用char* char*字符指针;string是类封装了char*,管 ...

  10. 如何查看JSP和Servlet版本

    我们在java web开发的过程中,有时在资料上可能会提到环境所要支持的JSP,Servlet版本.如果版本低就可能出现测试错误. 方法:打开tomcat的common/lib 目录下,有两个JAR文 ...