memcache.php flushes servers

August 28th, 2008 by Harun Yayli | 2 Comments »

Your good comments from all over the world about memcache.php is amazing. Thank you all!

I’ve recently received a contribution from Michael Gauthier. I took the liberty to tweak a bit and now memcache.php can flush individual server (no flush all servers yet).

File is now updated and you can get it from here.

PS: I didn’t receive any feedback from pecl guys about my previous update. I’ll post this to them again. I’ll announce when this version is in pecl/memcache CVS.

memcache.php can delete keys now

July 30th, 2008 by Harun Yayli | 4 Comments »

I’m receiving great comments from everyone since I’ve posted my memcache.php script. Thank you everyone.
I’ve just finished updating the memcache.php to support key deletion.
File is now updated and you can get it from here.
It’ll be updated on the cvs of pecl/memcache soon.

enjoy.

memcache.php is now part of pecl/memcache

June 3rd, 2008 by Harun Yayli | 3 Comments »

I’m very happy to announce that memcache.php is commited to the CVS of pecl/memcache. Woot woot!

I’ll be maintaining the code through the time as well. Hope you guys/gals find it useful.

PS: I’m planning to add more functionality to the memcache.php in the coming days. Candidates:

  • Delete/Expire a cached value
  • Move stuff from server to server

Let me know if you have any other ideas.

memcache.php goes PECL

June 2nd, 2008 by Harun Yayli | 2 Comments »

After the suggestion by Lukas, I’ve contacted PECL/memcache authors Antony Dovgal and Mikael Johansson. Mikael sent me a reply accepting my submission.
I’m looking forward to the day that memcache.php will appear in the pecl/memcache distribution.
I’ll keep you posted.

Update on memcache.php:

  • Small bug fixed on parsing the bucket Ids.
  • Distribution license is now PHP license.

memcache.php stats like apc.php

May 21st, 2008 by Harun Yayli | 19 Comments »

For a long time I was looking for a nice web interface like the apc.php (comes with the apc’s source) that displays whole nine yards of stats. The only good tool is memcache-tool from the danga guys. It’s quite complete but I guess I’m too lazy to go on the command line.

Anyways, I decided to rip write my own. Totally based on the original apc.php (I even recycled some functions) and apart from completeness, here is a memcache.php that you can get stats and dump from multiple memcache servers.
Here is a screenshot:
Read more…

oci_bind_by_name maxlength is not so optional

May 6th, 2008 by Harun Yayli | 4 Comments »

If you think that the maxlength parameter in the documentation of oci_bind_by_name is optional, see this example and think again.
Lets say you have your column names in an array already and you want to bind them in a loop smartly.
Read more…

Is Sun going to buy PHP too?(PHP Quebec 2008)

March 14th, 2008 by Harun Yayli | 5 Comments »

It was good 2 days at PHP Quebec Conf here in Montreal.

A lot of great sessions!!!!
My highlights:
- Great session by Eli White - High Performance PHP & MySQL.
- Really nice 2 sessions by Marc Wandschneider (The I18N and memcached sessions)
Some sessions I’ve attended were really really bad. I’m not going to name names :P
But overall, I guess it was worth taking 2 days from work and going to the php conf.

Here is the part about Sun and PHP:
Read more…

PHP APC apc_shm_create error on CLI

March 11th, 2008 by Harun Yayli | 1 Comment »

If you’re getting an error like this one below on Windows PHP commandline make sure that you are not running an apache server that uses apc on the same machine!

[apc-error] apc_shm_create: shmget(0, 8388608, 658) failed: No error. It is possible that the chosen SHM segment size is higher than the operation system allows. Linux has usually a default limit of 32MB per segment.

This was hard to figure! Tested with PHP 5.2.5, APC 3.1.0-dev.

Facebook’s Buggy Spam Detection

February 29th, 2008 by Harun Yayli | No Comments »

Oh my! I’ve heard people getting kicked out of Facebook because they were sending too much messages and facebook considered them as spamming.
One last thing is added to the pile. Now they are claiming the reader of a message is spamming people.
Oh boy, it is funny.
I’ve logged into Facebook and saw I’ve received a message. I clicked the message and boom! There is a red box saying I’m spamming people with messages and I’ll be blocked soon if I continue this.
Wait a minute! I’m not the one writing the message I’m reading it.
So as a responsible geek, I’ve send a message to Facebook and here is the result:

From: Facebook ([edited])
To: [edited]
Subject: Messages Help: bug in spam detection

Hello,
I clicked on the inbox to see a message that is coming to me. I clicked the message to read it (t=[edited])
I’ve received a box saying, I’m spamming.
You’re algo is buggy. I’m not sending messages, I’m reading a spam.
FYI

Answer:

Facebook Support [edited] wrote:
Hi Harun,

We are aware of the problem that you described and hope to resolve it as soon as possible. Sorry for any inconvenience. Let me know if you have any further questions.

Thanks for contacting Facebook,
James
User Operations
Facebook

Well at least they know that somebody made a booboo. Or not?

Test your PHP Facebook. I’m sure you have bugs in detecting the spam as well.

Is it Firefox or Zend Debugger? Cookie Standards

February 20th, 2008 by Harun Yayli | No Comments »

I’m frequently using Zend Debugger and recenlty it started not working with firefox so I decided to investigate. It still works with IE7 and Opera so it was weird to see Firefox being broken with the recent update (2.0.0.12).

When Zend Debugger starts, it sets a cookie on the browser, so when the request passes through the Debugger, it’s caught. Simple enough.

See the cookie that is set by Zend Debugger:
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/ ZendDebuggerCookie=192.168.33.87%2C127.0.0.1%3A10000%3A0||084|77742D65|0; path=/ SESSdd12cedd715988d11c29f14605e8aa57=rfem27em2jsn3l9ipusujaava2; path=/; domain=.127.0.0.1
Nothing looks weird to me…
But when firefox does a second request it returns only the cookies below:

Cookie: ZDEDebuggerPresent=php,phtml,php3; SESSdd12cedd715988d11c29f14605e8aa57=rfem27em2jsn3l9ipusujaava2

What happened to ZendDebuggerCookie? The little firefox ate it?
Plain weird.