apache php env build
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的更多相关文章
- 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 ...
- Apache 流媒体 拖动模块编译
Windows使用apxs独立编译 Apache 模块 http://blog.sina.com.cn/s/blog_43b83d340100mdhl.html 安装 apxs 1.解压apxs.zi ...
- apache atlas源码编译打包 centos
参考:https://atlas.apache.org/InstallationSteps.html https://blog.csdn.net/lingbo229/article/details/8 ...
- kafka-rest:怎么愉快的build?
愉快的build该项目吧 git clone https://github.com/confluentinc/kafka-restmvn clean install -Dmaven.test.skip ...
- (一)apache atlas源代码编译与打包
特别注意: atlas已经提供了0.8版本可以安装了,只有在国外的服务器上安装编译才比较顺利,可以按照官方文档去安装. 国内很多网址有被墙的问题,目前还没有完全解决,可能安装不成功 安装文档地址:ht ...
- 【大数据系列】apache hive 官方文档翻译
GettingStarted 开始 Created by Confluence Administrator, last modified by Lefty Leverenz on Jun 15, 20 ...
- C语言-apache mod(模块开发)-采用VS2017开发实战(windows篇)
C语言-apache mod(模块开发)-采用VS2017开发实战(windows篇) 名词解释:apxs apxs is a tool for building and installing ext ...
- tomcat:run和tomcat7:run的区别,以及Apache Tomcat Maven Plugin 相关
起因: 同事部署的maven项目,之前使用 jetty,现在切换到 tomcat,但是他使用的命令是 tomcat:run ,而不是 tomcat7:run,能启动,但出现问题了. 于是搜索了一番,想 ...
- @vue/cli3+配置build命令构建测试包&正式包
上一篇博客介绍了vue-cli2.x配置build命令构建测试包和正式包,但现在前端开发vue项目大多数使用新版@vue/cli脚手架搭建vue项目(vue create project-name) ...
随机推荐
- js_实用
[js提示] 文件中加 /// <reference path="exp_validate.js" /> 即可在当前js文件使用exp_validate.js中全局变量 ...
- iOS 项目中用到的一些开源库和第三方组件
iOS 项目中用到的一些 iOS 开源库和第三方组件 分享一下我目前所在公司 iOS 项目中用到的一些 iOS 开源库和第三方组件, 感谢开源, 减少了我们的劳动力, 节约了我们大量的时间, 让我们有 ...
- Linux open函数
Linux open函数 open 函数用于打开和创建文件.以下是 open 函数的简单描述 #include <fcntl.h> int open(const char *pathnam ...
- 常用SQL语句(工作)
1. 经销商 按店铺交易量汇总 ) from bp_shop_info i left join ( select t.shop_id,sum(t.shop_cost) as summary from ...
- flume-ng配置文档简单说明
1.配置文件现状 1.1 Flume数据接收端 IP地址:54.0.95.67 功能:接收各个端口发来的数据. 启动方式:进入目录 /usr/local/flume/*bin 在终端运行 ./rece ...
- JSch - Java实现的SFTP(文件下载详解篇)
上一篇讲述了使用JSch实现文件上传的功能,这一篇主要讲述一下JSch实现文件下载的功能.并介绍一些SFTP的辅助方法,如cd,ls等. 同样,JSch的文件下载也支持三种传输模式:OVERWRITE ...
- 浅析-博客Ping服务
简介:PING服务是博客站点向博客目标网站.搜索引擎等发出的博客内容更新通知服务,然后博客目标网站.搜索引擎就会及时的索引.收录以及传播您的博客内容. PING原理 PING 服务是博客站点向博客目标 ...
- iOS容易造成循环引用的三种场景
iOS容易造成循环引用的三种场景 ARC已经出来很久了,自动释放内存的确很方便,但是并非绝对安全绝对不会产生内存泄露.导致iOS对象无法按预期释放的一个无形杀手是--循环引用.循环引用可以简单理解为 ...
- linux下获取本机IP
转载:http://blog.chinaunix.net/uid-20593763-id-1620213.html 源代码级Unix/Linux 通用网卡IP地址获取方法 在Unix和Linux系统下 ...
- 【android异步处理】一个关于android异步处理的文章系列
最近读了Android异步处理系列文章索引,感觉这个文章系列写得不错!可以作为参考