Categories
Uncategorized

Finder stuck “Deleting xxx,xxx files” and then “Stopping…”

Note to self: Have to look up the exact messages and add them here.

Normally this occurs when deleting too many files using the trash in the empty trash phase. So because of some strange reason mac OS wants to show you the number of files to delete and starts counting them. Well many files are hard to count, right?! So it takes time and time… and you decide to cancel (stop) the process. Well now you have a non dismissable window on your screen that takes a lot of time until it disappears. So you will probably restart and then when you try to empty again the trash… guess what that happens again.

When the window is open trying to stop the empty trash action just move the folder with too many files outside of the .Trashes folder.

Here is how I did it:

1. Open a terminal
2. Run the command

sudo mv /Volumes/BackupDisk/.Trashes/501/Backups.backupdb /Volumes/BackupDisk/

3. To actually delete the files run the command:

sudo rm -rf /Volumes/BackupDisk/Backups.backupdb

Have a nice life!

Categories
Apache Web Server Linux mail PHP

PHP mail() function not sending email and no error was reported

The problem was that mail() method worked when invoked with php -r "mail('address@domain.tld', 'Subject', 'Message'); but when I tried it via the web server (apache in my case), in a php script, no email was sent and the mail method returned false. On top of this no error was displayed or logged anywhere not even error_get_last function did not return anything and I had display_errors and error_reporting activated and full E_ALL.

After trying all┬áthe possible tests that I could imagine I tried to send an email by executing the sendmail command form a php script. When I tried php’s shell_exec with sendmail:

shell_exec('/usr/sbin/sendmail');

and checked apache’s error logs got the error sh: /usr/sbin/sendmail: Permission denied. After I got this error it was obvious that the fix was to change the permissions for /var/qmail/bin/qmail-inject and /var/qmail/bin/sendmail so that apache can execute them.

Then said to myself: Happy developing! and that was it.

Categories
PHP Uncategorized

PHP Unknown error: Collator::__construct(): collator_create: unable to open ICU collator in Unknown on line 0

Full error message that occurred on mac (mavericks) homebrew version of php (php54, php55, php56) with php-intl (php54-intl, php55-intl, php56-intl) with intl.use_exceptions=1 and intl.error_level=E_ALL :

Unknown error: Collator::__construct(): collator_create: unable to open ICU collator in Unknown on line 0
PHP Fatal error: Uncaught exception 'IntlException' with message 'collator_create: unable to open ICU collator' in -:2
Stack trace:
#0 -(2): Collator->__construct('en_US')
#1 {main}
thrown in - on line 2

or without the default ini settings

PHP Fatal error: Call to a member function getLocale() on a non-object in - on line 3

Fatal error: Call to a member function getLocale() on a non-object in – on line 3

or in symfomny2

PHP Fatal error: Call to a member function asort() on null in APP_DIR/vendor/symfony/icu/Symfony/Component/Icu/IcuRegionBundle.php on line 79

After couple of hours I found the error to be inside icu4c library installed via homebrew.

The fix for this error is to reinstall the icu4c library, php and php-intl

brew reinstall icu4c php55 php55-intl