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. NOI模拟赛Day2

    深深的感受到了自己的水 ---------------------------------------------------------------------------------------- ...

  2. ios推送:本地通知UILocalNotification

    Notification是智能手机应用编程中非常常用的一种传递信息的机制,而且可以非常好的节省资源,不用消耗资源来不停地检查信息状态(Pooling),在iOS下应用分为两种不同的Notificati ...

  3. 关于加了hibernate 框架的项目启动特别慢的问题

    今天突然遇到一个问题,就是加了hibernate 框架的项目在启动的时候,特别慢,竟然达到了4分多钟,查来查去,看到我的bean类里*.hbm.xml,有这样的写法: <?xml version ...

  4. SolrCloud-如何在.NET程序中使用

    https://github.com/vladen/SolrNet 原来我们在我们的项目里用的是根据数据库路由到不同的单机Solr服务器,但是这样的话,每次Solr配置的修改都要修改三台不通的服务器, ...

  5. ng-repeat 指令

    <!--索引属性:$index,$first,$middle,$last--> <!--样式属性:ng-class-even,ng-class-odd--> <tr ng ...

  6. webdriver中处理alert

    1 定义isAlertPresent()供调用: public  boolean isAlertPresent() {  try {   driver.switchTo().alert();   re ...

  7. TF-IDF算法

    转自:http://www.cnblogs.com/eyeszjwang/articles/2330094.html TF-IDF(term frequency–inverse document fr ...

  8. Week1 学长的经验教训

    我手头拿到的是上一届学长的软件工程大作业,作业的名称是——汽车4S店信息管理系统. 这个大作业我认为还是非常典型的传统模式的大作业,由手机端(客户端)和服务端组成,非常的传统.             ...

  9. ArcGIS AddIN异常之:object reference not set to an instance of an object

    异常出现在 frmDownload frd = new frmDownload(); frd.ShowDialog(); 在ArcMap中能正常弹出窗体,点击按钮时显示此异常:object refer ...

  10. mysql sql注入

    防止SQL注入,我们需要注意以下几个要点: 1.永远不要信任用户的输入.对用户的输入进行校验,可以通过正则表达式,或限制长度:对单引号和 双"-"进行转换等. 2.永远不要使用动态 ...