Friday, April 14, 2006

Upgrading to PHP5

Today i tried to upgrade my PHP into the latest version, PHP 5.1.2. I had some trouble putting the extension since the default location was different from PHP 4. In PHP 4, i just put it in C:\Windows\System32 and it worked just fine, but in PHP 5, i had to put it in C:\PHP, the same directory where PHP resides. I had tried to modify the extension_dirs in php.ini but it won't work, until i finally i found the correct location. Some extensions that were built in on PHP 4 are no longer existed in PHP 5 as built in, but it came as extensions, such as MySQL. Some new extensions also been introduced in PHP5, such as SimpleXML and MySQLi. I had to edit php.ini file and put the extension file (php_mysql.dll, php_mysqli.dll, php_mbstring.dll, php_gd2.dll and libmysql.dll) in the directory which the extension should reside. Thanks to INSTALL.txt which comes in PHP5, i could make the extension i needed worked again.

One thing i like in PHP5 is that it is getting more strict. I have to use isset to make sure that i have declared a variable or to check whether query string existed. I had to change some code in my website to make sure it conforms the PHP5, but it is not a big deal for me, since it would make my code works in both version of PHP. One big problem that i had experienced was installing the PHPMyAdmin, since it requires MySQL extension and in the first, i don't know where should i put the dll files. But now it has been solved and it worked just fine. My JpGraph is already working too. The last thing that i should check is smarty, which i haven't checked yet, since i never use it for my apps. I'd rather use CSS to style my website.

I haven't upgrade my PHP on my Slackware system, since it would require more efforts, since i had to find the correct parameter in order to make sure that all i need will be installed on the system, so for now, i'll stick to PHP4 for my Slackware system. I don't use the OOP functionality on my website either, so PHP4 is enough for me.

No comments:

Post a Comment