[英]Php websites don't work after changin php version
我在Ubuntu 13.04环境中使用php。 我已经配置了apache,以便在我的主目录中有一个public_html
目录,其中存放着我正在处理的所有网站,并且可以使用localhost/~homedir/website
访问它们。 一切正常,但是几天前,我将php降级到5.3版本以尝试解决问题(后来我没有解决),然后回到php 5.4.9。 这发生在几天前,我不记得是否毕竟我检查了我的任何网站。 无论如何,今天我尝试访问一个,但没有成功。 在apache error.log文件中,我有这个:
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
我有这个:
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的某些配置文件已更改,但我不知道该做什么和做什么。 你能帮我弄清楚吗? 我还要发布其他信息吗?
编辑:
我想我已经找到问题所在了。 显然,升级php时会重新激活以下说明:
# 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>
所以,评论他们解决了这个问题(我希望)
添加.htaccess
文件并尝试
Options +FollowSymLinks
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.