Archive for the ‘Uncategorized’ Category

Don’t forget kids to check the size of the tmp partition if you are having issues uploading large files with PHP.
After setting all the usual configuration directives (upload_max_filesize, post_max_size etc) uploads were still failing for me returning error code 7.
After poking around on the Debian VPS for a while I realised the /tmp partition was [...]

The proper way to do this is with a static call to Debugger:
1Debugger::log($output);

To reset the key values in a PHP array you can do this:
1234567891011121314151617181920212223$things = array(’a',’b',’c',’d');
unset($things[0]);
print_r($things);

#outputs
#Array
#(
#    [1] => b
#    [2] => c
#    [3] => d
#)

# Actually do the reset.
$things = array_values($things);

print_r($things);
#outputs
#Array
#(
#    [0] => b
#    [1] => c
#    [2] => d
#)

Lots of love going about today! This time, the recipient is SSHFS which allows you to mount a remote filing system onto your local tree over SSH. In a virtual hosting environment (/vhosts/ etc) it’s pure joy to work with.
You’ll need to install SSHFS on the client (the machine you want to mount the remote [...]

Group and concatenate MySQL results and in this case make them distinct (unique):
1GROUP_CONCAT(DISTINCT landing_id ORDER BY landing_id SEPARATOR ‘,’) as landing_ids
This produces a series of values separated by comas: 1,2,3,4,5.
Useful component of sub/nested queries.

This will dump an SQL statement into a file:
1mysql -u username -p database_name -e "SQL_STATEMENT" > file.data


top