Saturday, January 22, 2011

Pear run-tests: Setting --cgi option to test file uploads using phpt

In PHP, file uploads can be tested using phpt files as explained here. However, when I wanted to execute phpt test with --POST_RAW-- or --POST-- sections, pear run-tests was giving an error that: --cgi option needed for this test, type 'pear help run-tests' My phpt file was as follows: The layout of phpt files is explained here. To overcome this problem I installed php5-cgi package for ubuntusudo apt-get install php5-cgiThis allowed for correct execution of the testpear run-tests --cgi=/usr/lib/cgi-bin/php5 example-upload.phpt
Running 1 tests
PASS Example test emulating a file upload[example-upload.phpt]
TOTAL TIME: 00:00
1 PASSED TESTS
0 SKIPPED TESTS

Sunday, January 02, 2011

Ubuntu 10.10: Change grub menu timeout

Default grub menu timeout is 10 seconds. To change it just edit the grub filesudo vim /etc/default/grub and change GRUB_TIMEOUT value from 10 to e.g. 2. Then update grubsudo update-grubAfter the restart the time before boot your default operating system be 2 seconds.

Alternatively, one can install GUI grub editor called StartUp-Manager sudo apt-get install startupmanager