PHP5 Installation
PHP5的安装
{{ This document is a rough draft }}
{{ 该文档只是一个大概的草案}}
代码: 全选
* Choose one web server
* 选择一个Web服务器
* Choose different modules
* 选择不同的模块
安装所有要求预安装的包并记住编译选项以备后用,编译后回到post compilation那一段,编译段在本页的最后。
Prerequisites
预安装
代码: 全选
* packages : build-essential, flex
* 包:build-essential, flex
Web服务器
Apache2 (module)
Apache2 (模块)
Prerequisites
代码: 全选
* packages : apache2-mpm-prefork, apache2-prefork-dev
* 包:apache2-mpm-prefork, apache2-prefork-dev
编译选项
代码: 全选
* --with-apxs2=/usr/bin/apxs2
代码: 全选
* > 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 模块
MySql?
Prerequisites
预安装
代码: 全选
* packages : libmysqlclient12-dev
编译选项
* --with-mysql
Compilation
编译
代码: 全选
* > ./configure [insert compile options here]?
* > make clean [only if make was run already]?
* > make
* > sudo make install
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”选项。