apache 启用php5支持有问题

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
头像
arbor
帖子: 312
注册时间: 2006-04-18 20:49
来自: 苏州
送出感谢: 1 次
接收感谢: 1 次
联系:

apache 启用php5支持有问题

#1

帖子 arbor » 2011-01-21 19:48

购买了本网站的VPS,做个小网站,静态没有问题,现在php支持有些问题,奇怪,软件都是从米国的官方源 apt-get 安装的
root@myhost:~# apt-get install php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@myhost:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
mountall
The following packages will be upgraded:
bsdutils libblkid1 libdbus-1-3 libuuid1 mount sudo util-linux
7 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,401kB of archives.
After this operation, 4,096B of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.
root@myhost:~# apt-get install php5-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-mysql is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@myhost:~# apt-get install libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-php5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
root@myhost:~#
root@myhost:/etc/apache2/mods-available# cat php5.conf
<IfModule mod_php5.c>
<FilesMatch "\.ph(p3?|tml)$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
# To re-enable php in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
php_admin_value engine Off
</Directory>
</IfModule>
</IfModule>
root@203736:/etc/apache2/mods-available#

现在用浏览器打开php页面,就提示下载
自行车运动摄影、足球摄影照片分享
qiaomu.org
头像
arbor
帖子: 312
注册时间: 2006-04-18 20:49
来自: 苏州
送出感谢: 1 次
接收感谢: 1 次
联系:

Re: apache 启用php5支持有问题

#2

帖子 arbor » 2011-01-21 20:16

重装了很多php5的包,然后重启apache,故障依旧
root@myhost:/home# apt-get install php5-common php5-dev php5-cgi php-apc php5-mysql php5-curl php5-gd php5-idn php-pear php5-mcrypt php5-memcache php5-ming php5-recode php5-tidy php5-xmlrpc --reinstall
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
autoconf automake autotools-dev binutils ca-certificates gcc gcc-4.4 gnupg gnupg-curl libc-dev-bin libc6-dev libcurl3 libcurl3-gnutls libgif4 libgomp1
libidn11 libltdl-dev libltdl7 libming1 librecode0 libssl-dev libtidy-0.99-0 libtool linux-libc-dev m4 manpages manpages-dev php5-cli shtool zlib1g-dev
Suggested packages:
autoconf2.13 autoconf-archive gnu-standards autoconf-doc gettext binutils-doc gcc-multilib automake1.9 flex bison gdb gcc-doc gcc-4.4-multilib
libmudflap0-4.4-dev gcc-4.4-doc gcc-4.4-locales libgcc1-dbg libgomp1-dbg libmudflap0-dbg libcloog-ppl0 libppl-c2 libppl7 gnupg-doc xloadimage imagemagick
eog libpcsclite1 glibc-doc libtool-doc automaken gfortran fortran95-compiler gcj
The following NEW packages will be installed:
autoconf automake autotools-dev binutils ca-certificates gcc gcc-4.4 gnupg gnupg-curl libc-dev-bin libc6-dev libcurl3 libcurl3-gnutls libgif4 libgomp1
libidn11 libltdl-dev libltdl7 libming1 librecode0 libssl-dev libtidy-0.99-0 libtool linux-libc-dev m4 manpages manpages-dev php-apc php-pear php5-cgi
php5-cli php5-curl php5-dev php5-idn php5-memcache php5-ming php5-recode php5-tidy php5-xmlrpc shtool zlib1g-dev
0 upgraded, 41 newly installed, 4 reinstalled, 0 to remove and 8 not upgraded.
Need to get 31.1MB of archives.
After this operation, 97.3MB of additional disk space will be used.
Do you want to continue [Y/n]? y


root@myhost:/home# !/etc
/etc/init.d/apache2 restart
* Restarting web server apache2 ... waiting [ OK ]
root@myhost:/home#
自行车运动摄影、足球摄影照片分享
qiaomu.org
回复

回到 “服务器基础应用”