php短标签在os x中不起作用

I've stumbled upon a strange problem. I made a regular os x system update (my os is Snow Leopard) and since then something strange happened to PHP. Now the short tags don't work anymore even though are enabled in the php.ini file. phpMyAdmin refuses to log me in. I cannot see the databases I had created even if I connect to MySQL through the terminal. Good thing is though that my still websites run perfectly.

You can verify easily whether the short tags actually work from the command-line.

$ php
<? phpinfo(); ?>
^D

My Apple-provided PHP obeys the short_open_tag = On -setting in the /etc/php.ini fine. Your database issues are not related to this, since they persist even with the MySQL command line.

To fix on Lion, go and edit the file /etc/php.ini , search the line short_open_tag = Off and replace it with short_open_tag = On , then restart apache (from command line this can be done by root by typing apachectl restart). This worked for me.