PHP: Profiling code and strict environment ~ Improving my coding

Posted by DavidYell on Stack Overflow See other posts from Stack Overflow or by DavidYell
Published on 2010-06-11T13:23:53Z Indexed on 2010/06/18 11:33 UTC
Read the original article Hit count: 283

Filed under:
|
|

I would like to update my local working environment to be stricter in an effort to improve my code. I know that my code is okay, but as with most things there is always room for improvement.

I use XAMPP on my local machine, for simplicities sake Apache Friends XAMPP (Basic Package) version 1.7.2 So I've updated my php.ini : error_reporting to be E_ALL | E_STRICT to help with the code standard. I've also enabled the XDebug extension zend_extension = "C:\xampp\php\ext\php_xdebug.dll" which seems to be working, having tested some broken code and got the nice standard orange error notice.

However, having read this question, http://stackoverflow.com/questions/133686/what-is-the-best-way-to-profile-php-code and enabled the profiler, I cannot seem to create a cachegrind file.

Many of the guides that I've looked at seem to think you need to install XDebug in XAMPP which leads me to think they are out of date, as XDebug is bundled with XAMPP these days.

So I would appreciate it if anyone can help point me in the right direction with both configuring XDebug to output grind files, and or just a great set of default settings for the XDebug config in XAMPP. Seems there is very little documentation to go on.

If people have tips on integrating these tools with Netbeans, that would be awesomesauce.

I'm happy to get suggestions on other things that I can do to help tighten up my php code, both syntactically and performance wise

Thanks, and apologies for the rambling question(s)!

Ninja edit

I should menion that I'm using named vhosts as my Apache configuration, which I think is why running XDebug on port 9000 isn't working for me. I guess I'd need to edit my vhost to include port 9000

© Stack Overflow or respective owner

Related posts about php

Related posts about Performance