更改 php 版本后,php 网站无法运行 [英] Php websites don't work after changin php version

查看:72
本文介绍了更改 php 版本后,php 网站无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 13.04 环境中使用 php.我已经配置了 apache,所以在我的主目录中有一个 public_html 目录,我可以在其中保存我正在处理的所有网站,我可以使用 localhost/~homedir/website<访问它们/代码>.过去一切正常,但几天前我将 php 降级到 5.3 版以尝试解决一个问题(然后我没有),然后我又回到了 php 5.4.9.这发生在几天前,我不记得在这之后我是否检查过我的任何网站.无论如何,今天我尝试访问一个,但没有成功.在 apache error.log 文件上我有这个:

I work with php in a Ubuntu 13.04 environment. I've configured apache so that in my home directory I have a public_html directory where I keep all the websites I'm working on and I can access them with localhost/~homedir/website. Everything used to work fine, but some days ago I downgraded php to version 5.3 to try and solve a problem (which then I didn't) and then I came back to php 5.4.9. This happened some days ago and I don't remember if after all this I checked any of my websites. Anyway, today I tried accessing one and it didn't work. On the apache error.log file I have this:

File does not exist: /home/carlo/public_html/website/index.php/welcome
Negotiation: discovered file(s) matching request: /home/carlo/public_html/website/index (None could be negotiated).

我常用的.htaccess是这样的:

RewriteEngine on
RewriteBase /~carlo/website/

RewriteCond $1 !^(index\.php|cache|captcha|fonts|forum|media|img|min|css|js|scripts|images|uploads|docs|robots.txt|sitemap.xml|sitemap|public|tools|assets|xd_receiver.htm)

RewriteRule ^(.*)$ index.php/$1 [L]

附带说明,phpmyadmin 正在运行.我可以使用 localhost/phpmyadmin 访问它.在 /etc/apache2/conf.d/apache.conf 我有这个:

On a side note, phpmyadmin is working. I can access it with localhost/phpmyadmin. In /etc/apache2/conf.d/apache.conf I have this:

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

<IfModule mod_php5.c>
        AddType application/x-httpd-php .php

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_admin_flag allow_url_fopen Off
        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/
</IfModule>

我觉得是降级升级php修改了一些配置文件,但不知道是哪一个,怎么做.你能帮我弄清楚吗?我要发布一些其他信息吗?

What I think is that downgrading and upgrading php some configuration file changed, but I don't know which one and what to do. Can you help me figuring it out? Shall I post some other info?

我想我已经发现了问题所在.显然,升级 php 以下说明被重新激活:

I think I've found out the problem. Apparently, upgrading php the following instructions were reactivated:

# 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>

所以,评论他们解决了这个问题(我希望)

So, commenting them solved the issue (I hope)

推荐答案

加入.htaccess文件试试

Options +FollowSymLinks 

这篇关于更改 php 版本后,php 网站无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆