Archive for April, 2013

Where’s the PHPUnit command-line test runner?

Posted on the April 29th, 2013 under Linux,Productivity,Software and Technology by

After you have installed the PHPUnit via PEAR, how do you get access to the phpunit executable. Here’s the steps from the beginning on Ubuntu.

1) Install PHP Pear if you don’t have it installed

sudo apt-get install php-pear

2) Enable auto discovery

sudo pear config-set auto_discover 1

3) Install PHPUnit via PEAR

sudo pear install pear.phpunit.de/PHPUnit

4) Locate the PHP PEAR bin(ary) directory

 pear config-get bin_dir

Mine shows:

tohir@tohir-MS-7759:~$ pear config-get bin_dir
/usr/local/zend/bin

If you then list the files in that directory, you’ll see:

tohir@tohir-MS-7759:~$ ls /usr/local/zend/bin
apachectl extract_meta_data.sh jqd.sh monitor-node.sh pecl phpize scd setup_sc.sh uninstall.sh zdd.sh ZManifest zs-setup
clean_semaphores.sh gui_passwd.sh lighttpdctl.sh pear php phpunit scd.sh shell_functions.rc watchdog zdpack zmd
create_cert.sh jqd MonitorNode peardev php-config rulemerge setup_jq.sh support_tool.sh zdd zendctl.sh zs-manage

You can then create a symlink to make it easier to access:

sudo ln -s /usr/local/zend/bin/phpunit /usr/bin/phpunit

wkhtmltoimage crashing at 25%

Posted on the April 13th, 2013 under Uncategorized by

I’ve had to turn off this functionality till I could find a fix. Sometimes, it worked, sometimes it didn’t. One URL in particular I had difficult fixing was: http://www.musjidnoor.za.net/index.html

Console Results

xvfb-run –auto-servernum –server-num=1 wkhtmltoimage –disable-javascript –use-xserver -f png -n ‘http://www.musjidnoor.za.net/index.html’ /var/www/docprogress_temp/1365305896.png
Loading page (1/2)
Rendering (2/2)
^C==============> ] 25%

Thought came in my mind, maybe it’s because there page is either big or long. Let’s try cropping the height:

xvfb-run –auto-servernum –server-num=1 wkhtmltoimage –disable-javascript –use-xserver -f png –crop-h 6000 -n ‘http://www.musjidnoor.za.net/index.html’ /var/www/docprogress_temp/1365305896.png
Loading page (1/2)
Rendering (2/2)
Done

Wallah, that seems to fix it. I gradually increase mine to 6000 which is more sufficient in my case. Suggestion, try adding –crop-h {a height}, and see if this fixes it.