PHP 整理(Linux,Freebsd)
1. Installation php
Installing PHP 4.4.1 (Linux)
1 2 3 4 5 6 7 | wget -P tar/ http://cn.php.net/get/php-4.4.1.tar.bz2/from/this/mirror tar jxvf tar/php-4.4.1.tar.bz2 cd php-4.4.1 ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs make -j 10 make install cp php.ini-dist /usr/local/php/lib/php.ini |
Configuring PHP (Linux)
vi /usr/local/php/lib/php.ini
#;default_charset = "iso-8859-1"
#在这行下面加一行
#default_charset = "gbk"
vi /usr/local/apache/conf/httpd.conf
#找到#AddType application/x-tar .tgz 这行,在下面加两行
1 2 | AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps |
#找到下面一行在后面加上index.php,这表示网站的默认页也能够为index.php
1 | DirectoryIndex index.html index.html.var index.php |
#注意:改变了http.conf后,要重启apache服务
#确认安装成功了解配制信息: echo "<? phpinfo(); ?>" >/usr/local/apache/htdocs/phpinfo.php
#访问http://yourserver/phpinfo.php
Installing PHP(FreeBSD port)
# cd /usr/ports/lang/php5
# make install clean
Adding the PHP 5 module to Apache(22) >>/usr/local/etc/apache22/httpd.conf
1 2 3 | DirectoryIndex index.php index.html index.htm AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps |
Configuring PHP (freeBSD)
# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini











































