我安装了Ubuntu 11.04,然后安装了apache2和php5。 问题是,它甚至给我500 phpinfo(); 脚本。 顺便说一句,CLI版本工作正常。 什么可能是错的?
还有一个问题:如何在init.d脚本的debugging模式下运行apache,或者使用正确的环境variables运行它?
UPD :在errors.log中写道:
[Mon May 30 23:41:40 2011] [alert] [client 127.0.0.1] /www/phpmyadmin/.htaccess:无效的命令'RewriteEngine',可能是拼错或由未包含在服务器configuration中的模块定义
.htaccess的内容是这样的:
RewriteEngine on # Allow only GET and POST verbs RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR] # Ban Typical Vulnerability Scanners and others # Kick out Script Kiddies RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR] # Ban Search Engines, Crawlers to your administrative panel # No reasons to access from bots # Ultimately Better than the useless robots.txt # Did google respect robots.txt? # Try google: intitle:phpMyAdmin intext:"Welcome to phpMyAdmin *.*.*" intext:"Log in" -wiki -forum -forums -questions intext:"Cookies must be enabled" RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|ia_archiver|Scooter|Ask.Jeeves|Baiduspider|Exabot|FAST.Enterprise.Crawler|FAST-WebCrawler|www\.neomo\.de|Gigabot|Mediapartners-Google|Google.Desktop|Feedfetcher-Google|Googlebot|heise-IT-Markt-Crawler|heritrix|ibm.com\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search|lucene.apache.org|NutchCVS|OmniExplorer_Bot|online.link.validator|psbot0|Seekbot|Sensis.Web.Crawler|SEO.search.Crawler|Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|www.urltrends.com|www.tkl.iis.u-tokyo.ac.jp/~crawler|SynooBot|[email protected]|TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator|www.WISEnutbot.com|yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC] RewriteRule .* - [F]
这是PHPMyAdmin提供的默认.htaccess,它在我的F14系统上工作得很好(当我有足够的GNOME 3时,我把所有的东西都打上了tar)。 奇怪的是,testing页面没有任何.htaccess文件的工作。 什么可以是这个错误的原因呢? RewriteEngine现在分开包吗?
你确定你有mod_rewrite启用?
尝试发布:
sudo a2enmod rewrite sudo /etc/init.d/apache2 restart
并看看问题是否依然存在。
从你的错误,问题是在您的.htaccess文件位于phpmyadmin文件夹中的configuration。 你可以重命名这个文件来确保apache不会像htaccess那样考虑它,或者把它发布到这里以供审查。
请注意:您发布的这个错误是针对特定的目录。 如果你尝试phpmyadmin文件夹之外的phpinfo()它应该仍然工作。