Thursday, March 15, 2007

Upgrading to PHP 5.2.x

I have been planning to upgrade my PHP to version 5.2.1 since several weeks ago, but I couldn't find spare time to do that until last night.

I upgraded the following packages (libedit is a new install) :

# rpm -Uvh php5-5.2.1-15.1.i586.rpm apache2-mod_php5-5.2.1-15.1.i586.rpm php5-gd-5.2.1-15.1.i586.rpm php5-mysql-5.2.1-15.1.i586.rpm php5-zlib-5.2.1-15.1.i586.rpm php5-pdo-5.2.1-15.2.i586.rpm php5-fastcgi-5.2.1-15.2.i586.rpm libedit-2.10.snap20061228-6.1.i586.rpm

After successfully upgraded those packages, I started my Apache webserver :
# rcapache2 start

Then I launched my browser and access the test file (index.php). The content only contains phpinfo() function.

Unfortunately, I can only see blank page.

I checked the error log and access log, but I can't find the error messages.

Next I check the PHP configuration (/etc/php5/apache/php.ini).

After looking through the configuration file around 11%, I found out what is the cause of this error. It looks like the new configuration turn-off the short_open_tag.

There are two things that I can do to fix this :

- I can turn on the short_open_tag config by setting :

short_open_tag = On


- I can change my PHP code to use the recommended open tag ("
After edited my PHP code, I restarted Apache server :

# rcapache2 restart

And now here is my PHP test page :

BTW, I just knew that this version is come with Suhosin. Yihaaa.

No comments: