[分享]PHP5的安装

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
头像
firehare
帖子: 2625
注册时间: 2005-04-10 16:54
来自: 温州大学
联系:

[分享]PHP5的安装

#1

帖子 firehare » 2005-05-16 11:42

由于安装Web服务器之后,一般都要支持当前几大服务器脚本语言:Perl,PHP及JSP,这里所介绍的是PHP5如何安装,毕竟PHP4是有包文件的。

PHP5 Installation
PHP5的安装

{{ This document is a rough draft }}
{{ 该文档只是一个大概的草案}}

代码: 全选

* Choose one web server
* 选择一个Web服务器
* Choose different modules
* 选择不同的模块
Install all prerequisites. Remember compile options for the end. Go back on post compilation chapters after compilation. Compilation is at the end of this page.
安装所有要求预安装的包并记住编译选项以备后用,编译后回到post compilation那一段,编译段在本页的最后。

Prerequisites
预安装

代码: 全选

* packages : build-essential, flex
* 包:build-essential, flex
Web server
Web服务器

Apache2 (module)
Apache2 (模块)

Prerequisites

代码: 全选

* packages : apache2-mpm-prefork, apache2-prefork-dev
* 包:apache2-mpm-prefork, apache2-prefork-dev
Compile option
编译选项

代码: 全选

* --with-apxs2=/usr/bin/apxs2
Post compilation

代码: 全选

* > sudo vi /etc/apache2/mods-available/php5.load
      DirectoryIndex index.php
      AddType application/x-httpd-php .php .php5
      AddType application/x-httpd-php-source .phps

* > sudo /etc/init.d/apache2 restart
* > sudo vi /var/www/index.php
       <?php phpinfo(); ?>
* > firefox localhost
PHP5 modules
PHP5 模块

MySql?

Prerequisites
预安装

代码: 全选

* packages : libmysqlclient12-dev
Compile option
编译选项
* --with-mysql

Compilation
编译

代码: 全选

* > ./configure [insert compile options here]?
* > make clean [only if make was run already]?
* > make
* > sudo make install
libxml2 --Thu, 10 Mar 2005 19:34:00 +0000

After followning through this on a clean load of Hoary, the config failed on libxml2. I had to simply install libxml2-dev and all was well.
在一个干净引导的Hoary上按照上述步骤操作,配置到Libxml2时失败,在我简单的安装Libxml2-dev后就一切正常了。

Thread Safe --Thu, 10 Mar 2005 19:46:12 +0000

This may or may not be an issue for someone, but if you're using an MPM (threaded) version of apache2 (most of you probably are), then you'll want to add the compile option "--with-tsrm-pthreads".
在你使用Apache2的MPM版本时,这可能对一些人来说是个问题,你可以在编译时加上“-with-tsrm-pthreads”选项。
我心无畏,源自于我心无知。
图片
头像
jerysun
帖子: 36
注册时间: 2005-07-13 20:25
来自: 山东
联系:

#2

帖子 jerysun » 2005-07-13 20:47

怎么看起来顺序好象不对呢?
--with-apxs应该是编译PHP的选项吧?
Apt装的Apache,哪里去找apxs呢?
Ubuntu 8.04
Sempron 2800+/256M×2/80GSATA/MX400
头像
firehare
帖子: 2625
注册时间: 2005-04-10 16:54
来自: 温州大学
联系:

#3

帖子 firehare » 2005-07-14 12:22

这篇文章是在www.ubuntu.com官方网站中取来翻译的。不过现在一叶兄刚把PHP5的包放了上去,这篇文章也就失去了意义了!楼上兄弟不妨用apt-get直接安装即可!
我心无畏,源自于我心无知。
图片
头像
ct
帖子: 2201
注册时间: 2005-04-06 21:15
来自: 安徽黄山
联系:

#4

帖子 ct » 2005-07-14 14:26

谁来讲下怎么装jsp环境吧,要apache2上面的。
我现在找到了一个实习java程序员的位置(还算不上工作),如果能在linux上搞定这个,就可以不用切换系统了。
回复