Archive for October 27th, 2008

short form or complete form

Monday, October 27th, 2008

Due to some work requirements I needed to install LAMP (Linux Apache Mysql y Php) over Windows (some new headache).

I downloaded, installed and configured the last version of every service without problems ( no comparison with sudo apt-get install mysql-server php5-mysql ).

When I try to test if the configuration is working I write a “phpinfo.php” file with the content:
< ? phpinfo() ? >

But when I open the page http://localhost/phpinfo.php I find that it’s completely empty.

So, I started looking into the log and restarting services/os until I think about changing the test code for:

< ? php phpinfo() ? >

which happened to work properly.

The problem was that one of the configuration options of php.ini, short_open_tag (that states if the short form of the opening tag “< ?” can be used instead of the complete form “< ? php” . Until now, this value was true by default, but it has been changed to false, so that the short tag was not recognized by the php module.

The reason for this is to allow the use of other tags starting with “< ?” like ‘< ?xml’ (in fact it’s still possible to use them by < ? echo '< ?xml'; ? >).

The general recommendation is to use always the complete form if it is necessary to have a portable code, because it is quite probable that otherwise, in a future, trying to run the code will not work.

Problems with the server again

Monday, October 27th, 2008

I’m having problems with Dreamhost again, this time is a 503 server error when trying to publish a post.