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 ? 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頁面,就提示下載
重裝了很多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
root@myhost:/home# !/etc /etc/init.d/apache2 restart * Restarting web server apache2 ... waiting [ OK ] root@myhost:/home#