当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 5 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : PHP5FromSource
帖子发表于 : 2005-08-26 23:59 
论坛管理员

注册: 2005-03-27 0:06
帖子: 10110
系统: Ubuntu 12.04
送出感谢: 7
接收感谢: 127
Note: There are currently three PHP5 pages on the wiki, this one, PHP5Installation and PHP5Installation2. If you're able to edit them down to just one page, please do! Remember to add redirects from the two pages you black, though - don't just delete those pages.

PHP4 does not require any special assembly or compiling; see ApacheMySQLPHP for PHP4 instructions.

Tested in Hoary.
Prerequisites
You must download PHP5 (of course ;)

wget http://www.php.net/get/php-5.0.4.tar.bz ... net/mirror
tar jxf php-5.0.4.tar.bz2
cd php-5.0.4/

You must install packages :

sudo apt-get install make g++ flex bison build-essential zlib1g-dev

You must have a webserver :

(apache2-prefork is better because it is thread safe)

sudo apt-get install apache2-mpm-prefork apache2-prefork-dev

(you can install with apache2-mpm-worker, but you need to delete the --with-tsrm-pthreads)

(you also can install Apache 1 (no problem with thread there)
You need a Mysql Database I Think :

(not necessary, but recommended)

Choose between 4.0 and 4.1

Mysql 4.0

sudo apt-get install libmysqlclient12-dev mysql-server

OR

Mysql 4.1

sudo apt-get install libmysqlclient14-dev mysql-server-4.1

You need development libraries

We will install PHP with a lot of options (mcrypt, mhash, bz2, xml, tidy...)

sudo apt-get install libmcrypt-dev libmhash-dev libxslt1-dev libtidy-dev libbz2-dev libxml2-dev libssl-dev

If you install GD (it is in my configuration below)

sudo apt-get install libpng12-dev libjpeg62-dev libxpm-dev libfreetype6-dev freetype2 freetype2-dev

Enable the multiverse repository to have the msttcorefonts (Useful for TrueType fonts with GD). The symbolic links is to Jpgraph to work without changing the configuration.

sudo apt-get install msttcorefonts
ln -sfn /usr/share/fonts/truetype/msttcorefonts/ /usr/X11R6/lib/X11/fonts/truetype

Compilation optimisation

You can speed up PHP with processor optimisation (optional)

If you have a different processor, change the CHOST, CFLAGS, CXXFLAGS.

If you don't know what it is, this 3 lines are optional, so don't do it !

*

Athlon-tbird XP (AMD)

export CHOST="i686-pc-linux-gnu"
export CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"
export CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"

*

Pentium 4 (Intel)

export CHOST="i686-pc-linux-gnu"
export CFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"
export CXXFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"

Configuration

This is a full configuration.

Do it in the PHP5 folder.

You can add/delete some of the options if you don't need it.

It is a strict PHP (no short tags, safe mode, no magic quotes etc...), but you can change it if you prefer or if some scripts doesn't work.

If you use Apache 1, change the --with-apxs2=/usr/bin/apxs2 with --with-apxs=/usr/bin/apxs

If you have only Mysql 4.0, delete the --with-mysqli=/usr/bin/mysql_config It is only with Mysql 4.1 !

./configure \
--quiet \
--disable-cli \
--disable-cgi \
--disable-all \
--disable-rpath \
--disable-debug \
--disable-path-info-check \
--disable-magic-quotes \
--disable-posix \
--disable-short-tags \
--disable-ipv6 \
--disable-static \
--disable-pcntl \
--without-pear \
--with-apxs2=/usr/bin/apxs2 \
--with-mysql=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-zlib \
--with-bz2 \
--with-dbx \
--with-ctype \
--with-openssl \
--with-pcre-regex \
--with-gettext \
--with-mcrypt \
--with-mhash \
--with-iconv \
--with-sqlite \
--with-sqlite-utf8 \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-xpm-dir \
--with-ttf \
--with-xsl \
--with-tsrm-pthreads \
--with-tidy \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-safe-mode \
--enable-calendar \
--enable-mbstring \
--enable-spl \
--enable-ftp \
--enable-bcmath \
--enable-sockets \
--enable-dom \
--enable-xml \
--enable-soap \
--enable-libxml \
--enable-session \
--enable-simplexml \
--enable-memory-limit \
&& make -s \
&& sudo make install \
&& sudo /etc/init.d/apache2 stop \
&& sudo /etc/init.d/apache2 start

The installation had automatically add PHP5 module to Apache Configuration
Testing

sudo echo "<?php phpinfo(); ?>" > /var/www/phpinfo.php
mozilla-firefox http://localhost/phpinfo.php


https://wiki.ubuntu.com/PHP5FromSource


_________________
当净其意如虚空,远离妄想及诸取,令心所向皆无碍


页首
 用户资料  
 
2 楼 
 文章标题 : 初译
帖子发表于 : 2005-08-31 9:54 
头像

注册: 2005-08-29 14:49
帖子: 1119
地址: 杭州
送出感谢: 0 次
接收感谢: 3
Note: There are currently three PHP5 pages on the wiki, this one, PHP5Installation and PHP5Installation2. If you're able to edit them down to just one page, please do! Remember to add redirects from the two pages you black, though - don't just delete those pages.
注意:目前这个wiki上有三个PHP5页面,包括本页、PHP5Installation和PHP5Installation2。如果你能把它们编辑合成到一个页面,就请动手吧!当然,记得在失效页面上加上重定向链接,而非只是把那些页面删除。

PHP4 does not require any special assembly or compiling; see ApacheMySQLPHP for PHP4 instructions.
PHP4不需要任何特殊的汇编或编译;参看适用PHP4的ApacheMySQLPHP导引。

Tested in Hoary.
Prerequisites
You must download PHP5 (of course)
在Hoary上测试通过。
前提
(当然是)你必须下载PHP5

wget http://www.php.net/get/php-5.0.4.tar.bz ... net/mirror
tar jxf php-5.0.4.tar.bz2
cd php-5.0.4/

You must install packages :
必须安装下列包:

sudo apt-get install make g++ flex bison build-essential zlib1g-dev

You must have a webserver :

(apache2-prefork is better because it is thread safe)
你必须得有个Web服务器
(有apache2-prefork则更佳,因它是线程安全的)

sudo apt-get install apache2-mpm-prefork apache2-prefork-dev

(you can install with apache2-mpm-worker, but you need to delete the --with-tsrm-pthreads)
(你可以安装apache2-mpm-worker,但得删除--with-tsrm-pthreads)

(you also can install Apache 1 (no problem with thread there)
(你页可以安装Apache 1(该版本不存在与线程相关的问题)
You need a Mysql Database I Think :

(not necessary, but recommended)

Choose between 4.0 and 4.1

Mysql 4.0
我想你还需要安装Mysql数据库:

(并非必需,但推荐安装)

选择安装4.0或4.1

Mysql 4.0

sudo apt-get install libmysqlclient12-dev mysql-server

OR


Mysql 4.1

sudo apt-get install libmysqlclient14-dev mysql-server-4.1

You need development libraries
你需要安装上述开发库。

We will install PHP with a lot of options (mcrypt, mhash, bz2, xml, tidy...)
安装PHP时我们将设置大量选项(mcrypt,mhash,bz2,xml,tidy……)

sudo apt-get install libmcrypt-dev libmhash-dev libxslt1-dev libtidy-dev libbz2-dev libxml2-dev libssl-dev

If you install GD (it is in my configuration below)
如果你要安装GD(它包括在下面的配置中)

sudo apt-get install libpng12-dev libjpeg62-dev libxpm-dev libfreetype6-dev freetype2 freetype2-dev

Enable the multiverse repository to have the msttcorefonts (Useful for TrueType fonts with GD). The symbolic links is to Jpgraph to work without changing the configuration.
需要使multiverse仓库存有msttcorefonts包(用于GD的TrueType字体)。下面的符号链接是为了不更改配置仍使Jpgraph(?)能够工作。

sudo apt-get install msttcorefonts
ln -sfn /usr/share/fonts/truetype/msttcorefonts/ /usr/X11R6/lib/X11/fonts/truetype

Compilation optimisation

You can speed up PHP with processor optimisation (optional)

If you have a different processor, change the CHOST, CFLAGS, CXXFLAGS.

If you don't know what it is, this 3 lines are optional, so don't do it !

编译优化

你可以借助处理器优化(可选)加速PHP

如果你的处理器类型不同,请更改CHOST、CFLAGS、CXXFLAGS。

如果你不知道这些是什么玩意,那就别劳心做更改了,下面这三行命令是可选的。

*

Athlon-tbird XP (AMD)

export CHOST="i686-pc-linux-gnu"
export CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"
export CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"

*

Pentium 4 (Intel)

export CHOST="i686-pc-linux-gnu"
export CFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"
export CXXFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fomit-frame-pointer -msse -mmmx -mfpmath=sse"

Configuration

This is a full configuration.

Do it in the PHP5 folder.

You can add/delete some of the options if you don't need it.

It is a strict PHP (no short tags, safe mode, no magic quotes etc...), but you can change it if you prefer or if some scripts doesn't work.

If you use Apache 1, change the --with-apxs2=/usr/bin/apxs2 with --with-apxs=/usr/bin/apxs

If you have only Mysql 4.0, delete the --with-mysqli=/usr/bin/mysql_config It is only with Mysql 4.1 !

配置

下面是一个完整的配置。

需在PHP5文件夹里进行操作。

根据自己需要,可以添加/删除其中一些选项。

这是一个严格的PHP配置(没有short tags短标签、safe mode安全模式、没有magic quotes等等),当然只要你愿意或碰到有些脚本无法工作,你可以对其进行更改。

如果你使用Apache 1,用--with-apxs=/usr/bin/apxs替换--with-apxs2=/usr/bin/apxs2

如果你只有Mysql 4.0,删除--with-mysqli=/usr/bin/mysql_config,它对Mysql 4.1才有效!

./configure \
--quiet \
--disable-cli \
--disable-cgi \
--disable-all \
--disable-rpath \
--disable-debug \
--disable-path-info-check \
--disable-magic-quotes \
--disable-posix \
--disable-short-tags \
--disable-ipv6 \
--disable-static \
--disable-pcntl \
--without-pear \
--with-apxs2=/usr/bin/apxs2 \
--with-mysql=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-zlib \
--with-bz2 \
--with-dbx \
--with-ctype \
--with-openssl \
--with-pcre-regex \
--with-gettext \
--with-mcrypt \
--with-mhash \
--with-iconv \
--with-sqlite \
--with-sqlite-utf8 \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-xpm-dir \
--with-ttf \
--with-xsl \
--with-tsrm-pthreads \
--with-tidy \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-safe-mode \
--enable-calendar \
--enable-mbstring \
--enable-spl \
--enable-ftp \
--enable-bcmath \
--enable-sockets \
--enable-dom \
--enable-xml \
--enable-soap \
--enable-libxml \
--enable-session \
--enable-simplexml \
--enable-memory-limit \
&& make -s \
&& sudo make install \
&& sudo /etc/init.d/apache2 stop \
&& sudo /etc/init.d/apache2 start

The installation had automatically add PHP5 module to Apache Configuration
该安装(配置)已自动把PHP5模块添加到Apache配置中。

Testing
测试

sudo echo "<?php phpinfo(); ?>" > /var/www/phpinfo.php
mozilla-firefox http://localhost/phpinfo.php


https://wiki.ubuntu.com/PHP5FromSource


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2005-09-07 21:00 
论坛管理员

注册: 2005-03-27 0:06
帖子: 10110
系统: Ubuntu 12.04
送出感谢: 7
接收感谢: 127
http://www.ubuntu.org.cn/support/docume ... howto_view


_________________
当净其意如虚空,远离妄想及诸取,令心所向皆无碍


页首
 用户资料  
 
4 楼 
 文章标题 :
帖子发表于 : 2006-07-30 18:09 
头像

注册: 2005-07-02 14:41
帖子: 4133
系统: Ubuntu 14.04 (Kylin)
送出感谢: 53
接收感谢: 11
过时了,现在不需要这么安装了
作废


_________________
https://weakish.github.io


页首
 用户资料  
 
5 楼 
 文章标题 :
帖子发表于 : 2006-07-30 18:09 
头像

注册: 2005-07-02 14:41
帖子: 4133
系统: Ubuntu 14.04 (Kylin)
送出感谢: 53
接收感谢: 11
:oops:


_________________
https://weakish.github.io


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 5 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译