linux php5.4装置要领:起首装置apache并解压php;然后举行编译装置;接着将“php.ini-production”复制到lib目次下并改名为“php.ini”;末了修正“httpd.conf”文件即可。
引荐:《PHP视频教程》
linux 下装置 php5.4.4
第一步:装置apache
第二步:解压php
[root@test02 software]# tar zxvf php-5.4.4.tar.gz
第三步:编译装置
[root@test02 php-5.4.4]# ./configure --prefix=/usr/local/php5.4 --with-apxs2=/usr/local/httpd2.2.22/bin/apxs --with-mysql
如许会在 /usr/local/httpd2/modules 目次下生成一个 libphp5.so, 并且在httpd.conf 中会自动加上
LoadModule php5_module modules/libphp5.so 这句
复制php解压目次下的php.ini-production 到 /usr/local/httpd2/lib 目次下,并改名为 php.ini
第四步:修正httpd.conf 让apache 能够熟悉php的扩展名
在httpd.conf末了加上
SetHandler application/x-httpd-php
Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php6,
and .phtml files to be executed as PHP, but nothing else, we'd use
this:
SetHandler application/x-httpd-php
And to allow .phps files to be handled by the php source filter,
and displayed as syntax-highlighted source code, use this:
SetHandler application/x-httpd-php-source
重启apache
以上就是linux php5.4 装置教程的细致内容,更多请关注ki4网别的相干文章!
收藏 | 0