Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed Ubuntu 11.04, then installed apache2 and php5. The problem is, it gives me 500 even for phpinfo(); script. The CLI version works fine, by the way. What could be wrong?

And another question: how do I run apache in debug mode from its init.d script or just run it with the correct environment variables?

UPD: in the errors.log it writes:
[Mon May 30 23:41:40 2011] [alert] [client] /www/phpmyadmin/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

The content of the .htaccess is this:

RewriteEngine on

# Allow only GET and POST verbs

# 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|\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search||NutchCVS|OmniExplorer_Bot||psbot0|Seekbot|Sensis.Web.Crawler||Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|||SynooBot||TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator||yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC]
RewriteRule .* - [F]

It is default .htaccess shipped with PHPMyAdmin, and it worked fine on my F14 system (I tarred the whole thing when I had had enough of GNOME 3). Strangely enough, the test page does work without any .htaccess file. What can be the reason for this error then? Does RewriteEngine come in separate package now?

share|improve this question
500 is a fairly broad error code. Anything in the error log that would help narrow it down? – Alex May 30 '11 at 16:02
Try to increase error level "LogLevel warn" in httpd.conf (it may be debug, info, notice, warn, error, crit, alert, emerg) Begin with "info" and look for something abnormal in the error log. Try to post it here. – HUB May 30 '11 at 16:16
There is this thing: [Mon May 30 23:41:40 2011] [alert] [client] /www/phpmyadmin/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration – Alexei Averchenko May 30 '11 at 16:43
up vote 3 down vote accepted

Are you sure you have mod_rewrite enabled?

Try issuing:

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

and see if the problem persists.

share|improve this answer
Yep, that was it. Crazy defaults, if you ask me :D – Alexei Averchenko May 30 '11 at 17:34

From your error, the problem is with a configuration in your .htaccess file located in the phpmyadmin folder. You can either rename this file to make sure apache does not take it into account as htaccess, or post it here for review.

Please note: this error you posted is for a particular directory. If you try phpinfo() outside of the phpmyadmin folder it should still work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.