免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2058 | 回复: 2
打印 上一主题 下一主题

[Web] 急啊!怎么配置Linux Apache PHP [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-19 20:50 |只看该作者 |倒序浏览
http.conf 怎么配置加载PHP

论坛徽章:
0
2 [报告]
发表于 2008-08-19 20:51 |只看该作者
有没配过的发个上来看看!!!!

论坛徽章:
0
3 [报告]
发表于 2008-08-20 11:38 |只看该作者
原帖由 fengxiaolt 于 2008-8-19 20:50 发表
http.conf 怎么配置加载PHP

有功夫发帖还不如google呢
其实就是加载模块
LoadModule php5_module        modules/libphp5.so
增加配置文件 看这个文章的末尾
<IfModule mime_module>#在这个里面增加
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico
DirectoryIndex index.php index.html index.html.var
</IfModule>
给你个步骤参考下:


# chmod 755 php-5.1.2.tar.bz2
# tar -xjvf php-5.1.2.tar.bz2
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/php --enable-snmp --enable-sockets --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/include --with-gd

Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.
# make
# make install
Installing PHP SAPI module:       apache2handler
/usr/local/apache/build/instdso.sh SH_LIBTOOL='/usr/local/apache/build/libtool' libphp5.la /usr/local/apache/modules
/usr/local/apache/build/libtool --mode=install cp libphp5.la /usr/local/apache/modules/
cp .libs/libphp5.so /usr/local/apache/modules/libphp5.so
cp .libs/libphp5.lai /usr/local/apache/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /home/suantop/php-5.1.2/libs'
chmod 755 /usr/local/apache/modules/libphp5.so
[activating module `php5' in /usr/local/apache/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/php/bin/
Installing PHP CLI man page:      /usr/local/php/man/man1/
Installing build environment:     /usr/local/php/lib/php/build/
Installing header files:          /usr/local/php/include/php/
Installing helper programs:       /usr/local/php/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/php/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.1
[PEAR] Console_Getopt - installed: 1.2
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
[PEAR] PEAR           - installed: 1.4.6
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
Installing PDO headers:          /usr/local/php/include/php/ext/pdo/

# cp php.ini-dist /usr/local/php/php.ini
# ll /usr/local/php/php.ini
-rw-r--r-- 1 root root 41317 03-28 11:14 /usr/local/php/php.ini

ln –s /usr/local/php/bin/* /usr/local/bin/

[root@test php-5.1.2]# vi /usr/local/apache/conf/httpd.conf

###############for php ###################
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico
DirectoryIndex index.php index.html index.html.var
#######################over########################
# /usr/local/apache/bin/apachectl -t
Syntax OK
# /usr/local/apache/bin/apachectl -k restart

[ 本帖最后由 xuledw 于 2008-8-20 11:42 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP