Derick recently blogged that “phar is cool!” Cool is great … but it doesn’t answer important questions: how does loading your application from a .phar file affect overall performance and scalability? How well does it work with leading bytecode caches?
Where are the benchmarks for phar? 
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
4 comments »
… as recommended by readers of Planet PHP
Most Recommendations
There were six Firefox extensions that folks repeatedly recommended …
- ColorZilla - advanced eyedropper, color picker, page zoomer and other colorful goodies.
- FireBug - live DOM & CSS inspector. The single greatest web developer add-on for Firefox.
- Live HTTP Headers - view HTTP headers of a page and whilst browsing.
- Web Developer Toolbar - adds a menu and a toolbar with various web developer tools.
- YSlow - Yahoo’s tool for analysing web pages and telling you why they are slow. Requires Firebug.
- Zend Studio Toolbar - debugging assistance for Zend Studio 5.5 and earlier. Isn’t mentioned on the Zend Studio 6 pages, so does that mean it is now obsolete?
… and after that, there was a lot of variety amongst the other extensions that were recommended.
Also Recommended
- Cache Status - easy cache status & management from the status bar.
- ChatZilla - IRC client for Firefox.
- Duplicate Tab - clone a tab along with its history.
- Edit Cookies - edit your cookies right in Firefox.
- Fasterfox - performance and network tweaks for Firefox.
- Firefox Accessibility Extension - test your web pages for functional accessibility features based on the iCITA HTML Best Practices.
- FirePHP - print to your Firebug console using a simple PHP function call.
- FireShot - take screenshots of web pages, and a whole lot more.
- Google Toolbar - Google’s famous in-browser search toolbar.
- GreaseMonkey - customise the way a web page displays using your own Javascript add-ons. See also Lifehacker’s Top 10 Greasemonkey User Scripts, and their Better GMail and Better Flickr add-ons to get an idea of just what can be done with Greasemonkey as a Firefox extension tool.
- HTML Validator - add HTML validation to your browser.
- IE Tab (Windows only) - open Firefox tabs using IE’s rendering engine. See also the popular IE View alternative.
- LocationBar2 - adds additional features to Firefox’s address bar.
- Lorem Ipsum content generator - Generate “Lorem Ipsum” dummy text, for when you need to fill a page with content for testing purposes.
- MeasureIt - draw out a ruler to get the pixel width and height of any element on the web page.
- NagiosChecker - see the status of your services and servers in Firefox’s status bar. You do monitor your servers, right?
- PrefBar - power user toolbar for Firefox.
- Regular Expressions Tester - testing tool for regular expressions with colour highlighting.
- RefSpoof - easy spoofing of the HTTP referrer header.
- ReloadEvery - reloads a web page every so many seconds.
- Save Session - save your current browser windows & tabs for the next time you open Firefox.
- Scrapbook - save web pages locally and easily manage collections. (Like OS X web archives, as supported by Together, DevonThink, and so on, but cross-platform).
- Selenium IDE - record, edit and debug tests for Selenium, the automated UI testing tool for web developers. See also PHPUnit’s support for Selenium. You do have reproducible testing for you web apps, right?
- Stylish - fix ugly sites, customise the look of your browser or mail client by using your own CSS files. Stylish is to CSS what Greasemonkey is to Javascript.
- Tab Mix Plus - tab management on steroids.
- Tamper Data - view and modify HTTP/HTTPS headers and POST parameters.
- TimestampDecode - treats the selected number as a timestamp and displays a decoded date/time.
- TitlebarTweaks - tweak Firefox’s titlebar text.
- User Agent Switcher - Adds a menu and a toolbar button to switch the user agent of the browser.
- Venkman - Javascript debugger for Firefox.
Stu’s Recommends
To round off the list, here are a few extensions that I find useful, but which weren’t recommended. If you haven’t heard of these before, give them a try.
- Flagfox - display a country flag in the status bar for the location of the current website’s server.
- Server Switcher - easily switch between development and production servers.
- Show MyIP - display your current external IP address.
- SQLite Manager - Manage any SQLIte database on your computer.
Are you a web developer? Got a favourite Firefox extension that isn’t on this list? Let us know in the comments below.
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
15 comments »
When it comes to web development, there’s no doubt that Firefox is king. What makes it king is the large collection of third-party extensions available for it. These days, just about everyone has heard about Firebug, but what other extensions would you recommend to folks who do web development?
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
25 comments »
I have a question for you: what features do you think a good PHP-centric ORM should offer?
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
11 comments »
If you’re using the Advanced TinyMCE Editor plugin in Wordpress (to replace Wordpress’s less-than-stellar WYSIWYG editor), make sure you disable it before upgrading to Wordpress 2.5. It isn’t compatible with the latest version of Wordpress atm, and you might not need it … Wordpress 2.5 includes a revamped WYSIWYG editor that (so far) seems to do a great job.
It even avoids screwing things up in Safari at last :)
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
3 comments »
Travis has just announced that he’s working on a book about Git, the version control system created for the Linux kernel by Linus Torvalds. This is great news, as there currently isn’t anything else out there in dead-tree form to help folks get up and running with this incredibly powerful distributed version control system.
It’s predicted that workplaces will change over the next ten years, with more and more people telecommuting rather than working in the office. Distributed people mean distributed teams - something that the open source world is already very used to. Git was specifically designed to solve the version control problems that distributed teams maintaining multiple branches face, and it’s slowly but surely gaining popularity amongst folks who’ve found Subversion’s branching and merging too painful to do.
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
Be the first to leave a comment »
Anyone know of a really great mind-mapping tool for OS X? It’s the one tool I haven’t picked up since buying my beloved MBP in 2006.
What I’m really looking for is something that supports a more 3D approach to mind-mapping than the traditional tools do (which just mimic pen and paper, at the end of the day). I feel constrained with having to hang all the nodes off a single central node - rich detail just doesn’t work like that, where things are much more interconnected. Ideally, it can cope with thousands of nodes, and support storing rich text or HTML in the notes at each node too. (Don’t want much, do I?
If you’ve got a favourite tool for this job, please leave a comment below. Ta.
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
8 comments »
Mike Willbanks recently wrote a good article about performance tuning. There’s some good advice in there, and I thought it’d be a good idea to quickly add a bit more detail about the separate approaches that Mike raises.
Mike recommended using APC for bytecode caching. APC’s pretty good, but just be aware that APC isn’t compatible with Sara’s excellent runkit extension. Xcache is, but some versions of Zend Optimizer refuse to run if they detect Xcache has been loaded. (Btw, Zend Optimizer is worth looking at, but because of the way Zend compile it, it can affect overall scalability. I haven’t sat down yet and worked out whether Zend Optimizer’s performance improvements make up for the cost of how the Linux kernel has to load it into Apache. I touched on the issues with how things are compiled last year, but haven’t followed it up yet with any definitive figures on scalability.)
If you don’t need Zend Platform’s download server (which rocks), then XCache + Zend Optimizer + Memcache out-performs Zend Platform substantially, and costs a lot less too
Zend Platform also isn’t compatible with runkit. It’d be great to see runkit supported better by accelerators.
Memcache is best suited to storing smaller pieces of data. If you’re using it to cache whole XHTML pages, they sometimes don’t fit into Memcache, and need to be cached on disk instead. (Always cache onto local disk, never NFS). Memcache divides the memory allocated to it into different size buckets for performance reasons, and there are far more small buckets than there are large buckets. You can edit the Memcache source code and change the size of the largest bucket before recompiling.
The GZIP trick Mike mentions just isn’t safe with IE6. There are copies of IE out there that fail to decrypt the content correctly alas
I remember reading a stat that it was about 1% of copies of IE had this bug, but I don’t have the link to hand. I have seen copies of IE with this bug myself. There’s nothing more frustrating than looking at two copies of IE, both reporting exact version numbers, and one copes with GZIPed data whilst the other one doesn’t
It’s possible that the widespread adoption of IE7 has “fixed” a lot of these buggy IE copies.
I’d recommend placing more emphasis on the Not Modified header, and also on making sure that your code is architected to send back Not Modified headers as quickly as possible. It not only improves per-page performance, but reduces per-page memory usage, and substantially improves scalability. Getting this right can make a huge difference, especially for sites where users normally view more than one page per visit. And make sure the metadata you use to work out whether or not you can send back the Not Modified header is fine-grained enough
Also, looking at the Not Modified header … don’t take it for granted that Apache is getting this right for your static files. I can’t remember which Apache module disables this off the top of my head (I think it was mod_includes, but I could be wrong), but check the HTTP traffic to make sure your site isn’t sending static files when it doesn’t need to.
With SQL queries of the form “SELECT … FROM table WHERE primaryKey IN ( … )”, be aware that the size of the IN list varies from database server to database server, and it doesn’t take all that big a list before you run into portability problems.
One important thing Mike didn’t touch on was about separating out static files onto a separate box. Apache + mod_php doesn’t serve static files very efficiently. With static files on a separate box, you can recompile Apache to use the “worker” MPM, which serves static files substantially better, or you can use an alternative web server such as lighttpd.
There are plenty of other things you can do to optimise PHP on servers, such as tuning Apache to prevent swapping, tuning the Linux TCP/IP stack to reduce connection failures at peak times, and moving your database off onto a separate box. I’m going to go into these in a lot more detail at a later date.
Finally, xdebug is a fantastic tool for profiling your code and telling you where you have inefficient loops and whatnot. It takes the guesswork out of finding bottlenecks!
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
11 comments »
My editor of choice for PHP for the last year or two has been phpEclipse. It’s the best compromise so far between IDE-like features (especially being able to search the entire code base, being able to have multiple projects open at once, and the absolute best class/function inspector in any PHP editor I’ve used so far - I can’t live without these features) and a text editor with acceptable performance (which is where Zend Studio has always lost out; can’t abide an editor that can’t keep up with my typing), syntax highlighting and code layout.
Unfortunately, phpEclipse doesn’t get released all that often (the last official release was 18 months ago now, although there are nightly CVS builds for folks who can afford to risk a broken PHP dev environment, and unfortunately I can’t afford that in my day job). That’s a long time to go without bug fixes and useful new features! It also suffers from that annoying Eclipse-ism of being unable to do anything for 10 minutes or so when you first open a project, whilst the workspace is rebuilt.
So I’m currently auditioning Textmate to see whether it can replace phpEclipse as my environment of choice. First impressions are pretty favourable (it supports projects, its fast, and the syntax highlighting is close enough) but it seems to lack a few useful features that phpEclipse has (like a class inspector - grrr, and being able to use phpdoc to provide context-sensitive help) and the performance seems to suck something awful when working on remote filesystems over 100mbit ethernet.
I was wondering if anyone else who reads Planet PHP has switched to Textmate, and if you’ve got any tips you can share on how to make Textmate a great PHP editing environment. If you do, please leave a comment below.
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
18 comments »
I’ve just seen Wez’s post about Microsoft’s new Community Technology Preview for their SQL Server 2005 extension for PHP.
Why Is It Important For Microsoft To Support PHP On Windows?
I can’t speak for the rest of the world, but Windows is an important platform here in the UK. About half the customers I work with run their websites on Windows Server. Every customer who prefers Windows Server over Linux automatically wants to use the full Microsoft stack, and that means IIS and Microsoft SQL Server.
Starting with Windows Server 2003 Service Pack 1, IIS became a viable platform for running production PHP sites on. SP1 has a fix for a nasty problem in the Windows kernel which stopped PHP working well as a CGI program under IIS. It’s true, IIS has serious limitations compared to Apache which cost time and money to overcome - chiefly no out-the-box equivalent to mod_rewrite - but it performs well and is simple enough for many folks to admin more easily than Apache (although the new IIS7 admin interface might be a step backwards there). With the new FastCGI support recently released, it’s now possible to further optimise an IIS setup too.
SQL Server is a true heavyweight database server. The most commonly deployed version that I come across is SQL Server 2000, although SQL Server 2005 is starting to appear in various enterprises. It is fast, scalable (in the old-fashioned way unfortunately, which is expensive), and when it comes to old-fashioned replication (as opposed to scale-out) I think that it leaves MySQL for dead. Although expensive to buy outright, if you buy your hosting boxes from places like Rackspace, the cost tends to be much more reasonable.
PHP comes with an MSSQL extension that’s based on the old TDS data protocol, which I believe is a legacy protocol from the old Sybase days (SQL Server is based on Sybase). TDS is also supported on Linux through the FreeTDS project, which allows PHP running on Linux boxes to connect to Microsoft SQL Server running on Windows.
What’s Wrong With The Existing MSSQL Extension For PHP?
… or, why do we need an improved SQL Server extension for PHP?
The existing MSSQL extension works well, but has a few practical limitations that have to be worked around.
- Limited to varchar(255) support. SQL Server 2000 and later support varchar columns longer than 255 bytes in size, but unfortunately the old TDS-based MSSQL extension can only support up to varchar(255).
- No support for unicode columns like nvarchar. The size of a varchar column is specified in bytes, not characters. If you’re working with UTF8 or UTF16 encoded data, one non-ASCII character takes up multiple bytes of space. This cuts down on the amount of characters you can store in a varchar field, and it makes things like HTML form validation - er - interesting. nvarchar, by contrast, is advertised as a variable-size datatype for storing multi-byte characters. nvarchar(255) holds 255 characters, not 255 bytes.
- No PDO drivers. Although there’s some debate about the performance merits of PDO, PDO’s prepared statement support is a real boon when it comes to preventing SQL injection attacks.
- Poor error reporting. The MSSQL extension doesn’t provide an equivalent to mysql_error() et al, which is a bit of a pain.
At the moment, I’ve no idea whether Microsoft’s extension addresses any of these issues. There’s no documentation online, just a .exe file that isn’t going to run under OS X
I’ll have a look at it when I get to my Windows PC at work, and see what it can - and can’t - do.
Share This
Did you enjoy this article? If so, subscribe to my RSS feed.
10 comments »