ubuntu Linux 测试PHP却提示下载文件的解决办法
2016-08-05 15:21
549 查看
ubuntu Linux 测试PHP却提示下载文件的解决办法
一般这种情况都是在刚刚开始配置环境时出现的,输入 sudo a2enmod php5 看提示如果出现“$ This module does not exist!”,
那么你就应该彻底删除libapache2-mod-php5并且重新安装,彻底删除可以用--purge参数,如下所示:
sudo apt-get remove --purge libapache2-mod-php5
sudo apt-get install libapache2-mod-php5
过程如下:
输入的命令用*******表示
**************************** dante@ubuntu:/var/www$ sudo a2enmod php5
[sudo] password for dante:
ERROR: Module php5 does not exist!
dante@ubuntu:/var/www$ sudo apt-get remove --purge libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libapache2-mod-php5 is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 312 not upgraded.
*********************** dante@ubuntu:/var/www$ sudo apt-get install ibapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ibapache2-mod-php5
********************* dante@ubuntu:/var/www$ sudo apt-get install libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-prefork php5-cli php5-common
Suggested packages:
php-pear php5-suhosin
The following packages will be REMOVED:
apache2-mpm-worker
The following NEW packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 php5-cli php5-common
0 upgraded, 4 newly installed, 1 to remove and 312 not upgraded.
Need to get 3,085 kB/6,612 kB of archives.
After this operation, 17.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
apache2-mpm-prefork php5-common libapache2-mod-php5 php5-cli
Install these packages without verification [y/N]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ oneiric-updates/main php5-cli i386 5.3.6-13ubuntu3.3 [3,085 kB]
Fetched 3,085 kB in 4min 14s (12.1 kB/s)
dpkg: apache2-mpm-worker: dependency problems, but removing anyway as you requested:
apache2 depends on apache2-mpm-worker (= 2.2.20-1ubuntu1.1) | apache2-mpm-prefork (= 2.2.20-1ubuntu1.1) | apache2-mpm-event (= 2.2.20-1ubuntu1.1) | apache2-mpm-itk (= 2.2.20-1ubuntu1.1); however:
Package apache2-mpm-worker is to be removed.
Package apache2-mpm-prefork is not installed.
Package apache2-mpm-event is not installed.
Package apache2-mpm-itk is not installed.
(Reading database ... 168658 files and directories currently installed.)
Removing apache2-mpm-worker ...
* Stopping web server apache2
... waiting ...done.
Selecting previously deselected package apache2-mpm-prefork.
(Reading database ... 168654 files and directories currently installed.)
Unpacking apache2-mpm-prefork (from .../apache2-mpm-prefork_2.2.20-1ubuntu1.1_i386.deb) ...
Setting up apache2-mpm-prefork (2.2.20-1ubuntu1.1) ...
* Starting web server apache2
...done.
Selecting previously deselected package php5-common.
(Reading database ... 168659 files and directories currently installed.)
Unpacking php5-common (from .../php5-common_5.3.6-13ubuntu3.3_i386.deb) ...
Selecting previously deselected package libapache2-mod-php5.
Unpacking libapache2-mod-php5 (from .../libapache2-mod-php5_5.3.6-13ubuntu3.3_i386.deb) ...
Selecting previously deselected package php5-cli.
Unpacking php5-cli (from .../php5-cli_5.3.6-13ubuntu3.3_i386.deb) ...
Processing triggers for man-db ...
Setting up php5-common (5.3.6-13ubuntu3.3) ...
Setting up libapache2-mod-php5 (5.3.6-13ubuntu3.3) ...
Creating config file /etc/php5/apache2/php.ini with new version
* Reloading web server config apache2
...done.
Setting up php5-cli (5.3.6-13ubuntu3.3) ...
Creating config file /etc/php5/cli/php.ini with new version
update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode.
******************* dante@ubuntu:/var/www$ sudo service apache2 restart
* Restarting web server apache2
... waiting ...done.
到此问题解决
相关文章推荐
- EasyEclipse for PHP打开(或单击)文件提示下载文件解决办法
- IE浏览器打开网页时提示下载php文件的解决办法
- 安装完Apache和PHP之后访问PHP文件页面提示下载而没有解析 解决办法
- 测试php文件提示下载而不是显示php信息
- 【解决办法】ubuntu linux 64执行adb提示,没有那个文件或目录。
- php文件下载不完整的解决办法
- 论坛注册、登陆、发帖、回帖弹出下载php文件页面解决办法
- 库文件提示无法下载的解决办法
- cocos2d-x iOS真机下载非根目录文件提示下载失败解决办法
- 访问php文件,但是提示找不到php_mbstring.dll的解决办法
- 下载的时候提示:“写入到文件时产生错误(请用磁盘检查工具检查修复)”的解决办法
- 服务器IIS无法提供某种扩展名的文件的下载或访问某种类型文件提示http 404 错误时的解决办法
- github下载文件,提示链接超时的问题解决办法
- PHP IE下载时提示”无法复制 无法读取源文件或磁盘”的解决办法
- PHP下载文件 文件太大而找不到文件的解决办法
- Jquery form.js文件上传返回JSON数据,在IE下提示下载文件的解决办法,并对返回数据进行正确的解析
- 经测试能用springmvc的文件上传下载并解决ie8文件上传后提示下载
- PHP IE下载时提示”无法复制 无法读取源文件或磁盘”的解决办法
- Windows 2008 R2 标准版 ie提示 当前安全设置不允许下载该文件 解决办法
- jboss 下载xls 不提示下载框 直接打开文件了 解决办法