• 7 九月 2009

Mysql client uses older authentication method in PHP 5.3 on windows?

Just found out the if I use PHP5.3 on windows, I can’t connect to my Mysql5 server. It says my client is too old. After I switch back to PHP5.2.9, things get normal. So, it means the PHP5.3 for windows used a older version of library to compile the code? I don’t know. It took me a while to find out the problem.

  • 2 五月 2008

Curl better than simplexml_load_file when web screen scrapping

As in my previous post, I briefly introduced how you can use SimpleXML object to load various web services’ API query urls, if you so choose to mashup a website with data provided by the various websites, such as YouTube and Amazon. Of course, the pay off comes when you use some affiliate code in your query, such as the famouse Amazon’s ECS and you did a pretty well job on your page layout & design, and seo to attract many visitors to you sites. (more…)

last comments
lakshan
lakshan

thank you very much for this article..

  • 19 四月 2008

How to use SimpleXML parsing XML data with namespace and CDATA

There are many social network websites (e.g. YouTube) and big brand websites(e.g. Amazon, Yahoo) use REST or SOAP or even RSS web services to provide the enormous data for developers. Using these data, we can build a website virtually with no own database at all, all the information are come from these big sites. The nice thing is that, virtually all of the data returned for your web service client request are a XML data stream. So, we can use the nice PHP5 built in SimpleXML object to parsing the XML data stream, and format the representation of the data according our own website needs. However, the XML data format vary from site to site, some of the XML data returned from the sever, includes namespace and CDATA; if this is the case, you need find a way to access a sub item in the XML data use the same ” -> ” syntax. (more…)

last comments ...
clonks
clonks

Thanks! GREAT!
jcvangent
jcvangent

To speed things up (since I only want the description),if I do an: $entry->children('http://search.yahoo.com/mrss/')->group->description; It…
jcvangent
jcvangent

even when doing it like the example above it gives me an empty string: $media =…
David Adam
David Adam

Are you sure the live feed you got is in correct format. Here is the code I run on the…
jcvangent
jcvangent

What is the url you are using for getting the xml feed, currently I'm using 'http://gdata.youtube.com/feeds/base/videos/-/dance' for example as a…

  • 13 四月 2007

在Windows上配置PHPEclipse, SVN和Apache.

过去的一个月,我正忙于增进我关于PHP,Ruby on Rails and Prototype(一个Javascript的框架)的知识。Ruby on Rails 真会让世界震惊!不过,由于我最常用PHP,所以我只是想找到一个比较好的编辑器,以便于我在PHP上的工作,你知道,就是调改某些开放源代码的内容管理系统(CMS)。于是,我找到这本介绍PHPEclipse的书:Phpeclipse: A User GuidePhpeclipse: A User Guide。结果是非常让人兴奋的,我不仅得到了一个好的编辑器,还得到了一个高质量的企业及水平的IDE!——由于每个组件,包括Eclipse本身,都是开放源代码的,所以他们没花我一分钱。但是,对于把我的PHPEclipse与Subversion整合起来一起工作来说,确实有一些困难。这个帖子将介绍一些当你在Windows上创建subversion的基于Apache的服务器和PHPEclipse的subversion的客户时要注意的一些事情(我用的是Windows XP SP2)。

首先,你需要知道的是,当前的PHPEclipse版本PHPEclipse1.1.8并不与Eclipse 3.2.X兼容,所以你需要下载并装上Eclipsse 3.1.X的版本。

其次,你必须首先正确地装上基于Apache的Subversion服务。经过在网上的一番很长时间地搜索,我相信这个由Aaron West撰写的帖子——配置一个基于Apache,Subcersion,TortoiseSVN以及Subclipse的开发环境——是一个最具体的教你如何做这个的文章。然而,需要注意的是,这篇文章用的是Apache 2.0.59,这是因为当前的subversion Apache mod, Mod_authz_svn.so和mod_dav_svn.so 并不与高于Apache2.2版本的Apache相兼容。你们很有可能用的是XAMPP,因为有很多地方都推荐它;但是,XAMP的最近版本是基于Apache2.2.4,所以这是不行的。我通过一段很长的路找到了一篇关于这件事的很有趣的故事——由Aral Balkan撰写的:在Windows上让SVN与WebDav一起工作……。相信我,作者很有趣味地讲述了这个故事,我每次读它都几乎笑个不停。 由于我不想以及不能在我自己的机器上编译Apache2.2.4,所以这个故事给了我一些WAMP如何可能会工作的眉目。然而,当我访问了WAMP Server的官方网站后,了解到当前的WAMP版本也是基于Apache2.2.4的。幸运的是,我以前在我的硬盘上保留了一份WAMP的早期版本,所以,当我装上了那个版本以后,我可以用我在Asron的那个帖子里找到的指令来配置基于Apache的subversion 服务。无论如何,这里关键的是你必须用Apache2.0.X, 如果你想将subversion 服务配置于Apache上的话。

第三件你必须留心的事是,由于用Eclipse3.1.X,所以the Eclipse Subversion plugin需要其subclipse 1.0.5的版本,而不是其用于Eclipse3.2.X中的最近版本。实际的装载过程是非常容易的,但是,当你装载完成后重起和每一次运行Eclipse,在Eclipse中的错误登入信息中,你会发现像如下的错误讯息:


While loading class "org.tigris.subversion.subclipse.ui.console.ConsoleDocument$ConsoleLine", thread "main" timed out waiting (5000ms) for thread "Worker-1" to finish starting bundle " org.tigris.subversion.subclipse.ui". To avoid deadlock, thread "main" is proceeding but "org.tigris.subversion.subclipse.ui.console.ConsoleDocument$ConsoleLine" may not be fully initialized.

根据我在subversion的邮件列表中发现的信息,这种现象好像对于Eclipse3.1.X中的subclipse1.0.5很正常;并且在Eclipse3.2.X中的subclipse的最近版本中,这一错误讯息就没有了。