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.
我偶然发现了一个奇怪的问题。 我做了一个常规的os x系统更新(我的操作系统是Snow Leopard),从那时起PHP发生了一些奇怪的事情。 现在,即使在 php.ini code>文件中启用了短标签,它们也不再起作用了。 phpMyAdmin拒绝登录。即使我通过终端连接到MySQL,我也看不到我创建的数据库。 好的是,我的静止网站运行得很好。 p>
div>
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.