cfinke/OSX-Messages-Exporter

Not working on MacOS Monterey

eliransapir opened this issue · 4 comments

Tried php version 8.1.1 and received the following error:

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /messages-exporter.php on line 305
PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /messages-exporter.php on line 305

Tried php version 8.0.14 and received no error but the script silently failed.

e712160 fixes the notices about str_replace(), and e1a2f7c fixes another issue in PHP 8 that generates a deprecation notice.

I haven't upgraded to Monterey yet, but with these changes, it runs fine for me in PHP 8.1 on Big Sur. Can you try the latest version and see if it works for you?

I just installed php via brew on Monterey: PHP 8.1.6 but I'm getting this error:

/usr/local/bin/php ~/Library/github/OSX-Messages-Exporter\ master/messages-exporter.php --path-template "%Y-%m-%d _CHAT_TITLE_" --output_directory ~/Files/Correspondence\ -\ Messages/OSX-Messages-Exporter-Extracts
PHP Fatal error:  Uncaught Exception: Unable to open database: unable to open database file in /Users/john/Library/github/OSX-Messages-Exporter master/messages-exporter.php:207
Stack trace:
#0 /Users/john/Library/github/OSX-Messages-Exporter master/messages-exporter.php(207): SQLite3->__construct('/Users/john/Lib...', 1)
#1 {main}
  thrown in /Users/john/Library/github/OSX-Messages-Exporter master/messages-exporter.php on line 207

Fatal error: Uncaught Exception: Unable to open database: unable to open database file in /Users/john/Library/github/OSX-Messages-Exporter master/messages-exporter.php:207
Stack trace:
#0 /Users/john/Library/github/OSX-Messages-Exporter master/messages-exporter.php(207): SQLite3->__construct('/Users/john/Lib...', 1)
#1 {main}
  thrown in /Users/john/Library/github/OSX-Messages-Exporter master/messages-exporter.php on line 207

@john-catalano My guess would be that you haven't given Terminal Full Disk Access: https://osxdaily.com/2018/10/09/fix-operation-not-permitted-terminal-error-macos/

Can you try that and let me know if it works?

@john-catalano My guess would be that you haven't given Terminal Full Disk Access

That was it. Thank you.