Prestashop and APC

When you do a fresh install of prestashop, just after it finishes you need to rename the “admin” directory. The problem is that with the last two installs we did (as part of WebIngenia), we ended up with a blank/empty/white webpage. The only way to solve it was to clear the opcode cache from APC. So, if you encounter the same problem, you know what to do, you just need to clear the APC opcode cache and continue the install. ...

October 4, 2010 · Florent Clairambault

WP-Codebox fix so that it doesn’t prevent posts export

If you have a PHP configured with some open_basedir restriction (which is recommended), the WP-Codebox plugin will prevent you from exporting the posts of your blog. Go to your blog, go in the “wp-content/plugins/wp-codebox” dir and edit the “wp-codebox.php” file : On line 27, you should have : include_once "../../../wp-config.php"; include_once "../../../wp-settings.php"; Well, it fails because the plugin doesn’t use the good practices, so it’s pretty easy to fix : require_once( ABSPATH.'/wp-config.php' ); require_once( ABSPATH.'/wp-settings.php' ); I’d like to thank the developer of this plugin for doing such a great job. It brings the power of geshi (not the latest version by the way) into wordpress. ...

May 15, 2010 · Florent Clairambault

Linux prioritization : do more with less

I find the concept of prioritization very interesting. It just enables you to do more with less. Doesn’t that sound great ? Let’s say you want to be able to respond to user requests as fast as possible but update your data in a low priority manner : You can set the process CPU priority from -20 (high priority) to 19 (low priority) by using the command : nice -n <priority> <command> You can set the process IO priority in 4 classes (0: none, 1: realtime, 2: best-effort, 3: idle) with some priorities within these classes (0-7, lower being higher prio). But you have to enable the CFQ (Complete Fair Queueing) scheduler first by typing something like that : ...

March 7, 2010 · Florent Clairambault

Dirty WordPress APC caching

One or two weeks ago, I made a simple AB benchmarking test on a PHP site I built, it was ok. Then I did the same test on this blog and well… It was freaking slow… On 100 pages with 10 concurrent access, it took 3.5 to 10s to render. Well, I thought I should remove all these plugins I installed to make me and my blog famous (they didn’t perform well). It reduced the generation time by something like 100 ms. ...

February 13, 2010 · Florent Clairambault

WordPress with APC

I updated APC from 3.0 to 3.1 because it totally locked my webserver, it was making it accept HTTP connection but never give any reply. I had some problem accessing the WordPress 3.0 (latest SVN version) admin interface after that upgrade : Fatal error: Call to undefined function wp_dashboard_setup() in /home/sites/clairambault.fr/florent/wp-admin/index.php on line 15 the bad line is : require_once(ABSPATH . 'wp-admin/includes/dashboard.php'); I just found out here it was because I activated APC with the “apc.include_once_override” option set to 1. If you encounter the same problem, just set it to 0 or change the include by something without the ABSPATH constant like for instance : ...

February 12, 2010 · Florent Clairambault

Push (Comet) or pull ?

What is it ? Most of the modern web applications display recently updated data, and to do that they need to get he latest data very frequently. Some of them even include some real-time chat (Gmail Chat, Facebook chat). How ? That’s the interesting part. Pull is pretty dumb. You do a request very frequently and you see if anything new appeared. This consumes some bandwidth, some resources (because server has to check if data has actually changed). Push is going back to the source : Once you’ve made the request on the server, it doesn’t reply instantly. It will wait for something before sending anything. So push over HTTP is in fact a pull with a sleeping response. Using push over HTTP is called Comet. So pushing data isn’t very complex, it just requires a special server to transmit some data (text, html, xml, or image) over an already opened HTTP connection. ...

November 23, 2009 · Florent Clairambault

Automatic error reporting in PHP

I edited this page on the 21 March 2010 because a lot of people seem interested and the code as since improved ! PHP has a pretty interesting feature, you can define a callback method to “catch” any error “thrown” in your code. And I’m sure most of you don’t use it. It’s really usefull when you want to make sure to detect error before any user reports it (which can takes time). This is all about avoiding to demolish with some lame errors your “user experience”. ...

February 15, 2009 · Florent Clairambault