PHP5在Linux下安装
Linux下安装PHP5的主要步骤:
1.下载php5;地址:http://cn.php.net/downloads.php
2.解压软件包后进入该目录
(转者注:
可能会需要先解压php-5.*.tar.bz2 ,先执行bzip2 -d php-5.*tar.bz2
)
tar -xvf php-5.*.tar.gz
cd php-5.*
3.php安装mysql的模块的一些准备工作
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
ln -s /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config
注意:(以后再重新编译不需要执行这些操作)
4.编译安装
#./configure --prefix=/opt/php5
--with-apxs2=/opt/httpd/bin/apxs --with-zlib
--with-config-file-path=/etc --bindir=/usr/bin --sbindir=/usr/sbin
--with-curl --with-exec-dir=/usr/bin --with-xml --with-xmlrpc=shared
--enable-magic-quotes --enable-sockets --enable-mbstring=all
--with-mysql=/usr/bin
(转者注:
其中-prefix为php5安装路径,-apxs2为apache目录下的bin/apxs。)
#make
# make install
5.apache 配置
a、# touch /opt/httpd/conf/extra/httpd-php.conf
文件内容如下:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php5_module modules/libphp5.so
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
b、修改 httpd.conf,在最后添加一行
vi httpd.conf
....
# php modele
Include conf/extra/httpd-php.conf
c、重启 apache 使之生效。
转自: Linux公社
原文地址:http://www.linuxidc.com/Linux/2008-10/16738.htm
个人总结:安装过程中出现了一些问题,主要是配置参数那里,原因是apache路径不同(“--with-apxs2=/opt/httpd/bin/apxs")
,导致第一次安装没有作用,后来把配置参数改成
“--
相关文档:
function _processBeforeDb($str)
{
$str = str_replace ( array ('<', '>' ), array ('<' , '>' ), $str );
if (!get_magic_quotes_runtime()){
return addslashes($str);
}
else
{
return $str;
}
}
......
linux下apache+php安装常见问题
configure: error: Unable to find libgd.(a|so)
如果使用的是ubuntu或debian就很简单了,直接sudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd 就基本上搞定,但是用源代码安装还是很麻烦~
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0.11 ......
一.安装
1.到网上下载rar for linux
2.tar zxvf rarlinux-3.7.b1.tar.gz
3.make
二.使用
1. rar e test.rar 解压RAR档
2. rar a 压缩后的文件名.rar 待压文件或目录
三.问题
若运行RAR提示如下:
rar: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by rar)
则用里面提供的 rar_stati ......
Linux相比于Windows一个比较好的地方在于Linux提供了非常丰富的在线文档,更重要的是这些都是free的(下面的说明是针对debian发行版,其他的发行版情况可能会有所不同)。
Linux的在线文档大概可以分为以下几类:
(1)Man格式的手册,默认存放于/usr/share/man目录,用man命令查看。
(2)Info 格式的手册,默认存放 ......