dpjj4763
dpjj4763
2012-02-05 01:07

将PHP代码从5.2迁移到5.3

已采纳

I was asked to help getting a website that was running with 5.2 php code, to work on a 5.3 php server. The site is big, and I can't see the errors that would appear normally when a site isn't working.

I've tried to use the Search and replace function that Dream Weaver has, and simply use it all over the website. But the problem is that I only want to replace functions in PHP documents, and not in js files. When i use Search and replace, in Dreamweaver, it overwrites the js files aswell, and that would cause more errors. Because there's A LOT of files that i have to go through, it would take me a lot of time if i had to go through it manually.

I figured this must be a problem that a lot of firms experiance, so there must be ways to handle this without it being a bigger hassle.

Anybody out there who could help me out ? Any help is much appreciated!

Regards, Mathias

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • dqy006150 dqy006150 9年前

    Check out the official guide about Migrating from PHP 5.2.x to PHP 5.3.x

    most existing PHP 5 code should work without changes, but make sure error-reporting is enabled to get some idea of what is going wrong .

    点赞 评论 复制链接分享
  • duansha6410 duansha6410 9年前

    Dont worry about it! If your code works in php->5 for the most part it will work just fine. 5.3 offers a plethora of options but no doubt your not using them.

    点赞 评论 复制链接分享
  • doushi3189 doushi3189 9年前

    I would recommend the use of sed from command line. It is most likely the fastest and most powerful find/replace utility available for LAMP developers.

    http://www.grymoire.com/Unix/Sed.html

    点赞 评论 复制链接分享