Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Error Seems to be Breaking Calculate Anything #127

Closed
jelias opened this issue Aug 7, 2023 · 3 comments
Closed

PHP Error Seems to be Breaking Calculate Anything #127

jelias opened this issue Aug 7, 2023 · 3 comments

Comments

@jelias
Copy link

jelias commented Aug 7, 2023

If you have a problem with the workflow please answer the following questions. Please note that the workflow is only compatible with Alfred 5.

Are you using the latest version of the workflow?
Yes, version 4.0.2 from the Gallery
Before creating an issue make sure you are using the latest version, you can find the latest version in the releases page

Have you installed the workflow dependencies?
if dependencies are not automatically installed by Alfred you can install them directly from Alfred following this steps https://www.alfredapp.com/help/kb/dependencies/ or manually install PHP with brew brew install php

Describe the bug
It seems Calculate Anything is failing to display results or any sort of visual in the Alfred input window. Only when I read the logs do I see anything happening.

To Reproduce
Steps to reproduce the behavior:

  1. Open workflow and debugger
  2. Open Alfred input
  3. Type '5lbs to oz'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.
I have yet to get the workflow to work, but I imagine it would show results if I did 5lbs to oz. Not just the Alfred defaults (google search) which is what currently happens.

Debug Output

[15:05:31.357] Calculate Anything[Script Filter] Queuing argument ' lbs to oz'
[15:05:31.423] Calculate Anything[Script Filter] Script with argv '(null)' finished
[15:05:31.430] STDERR: Calculate Anything[Script Filter] PHP Warning:  Failed loading Zend extension 'xdebug.so' (tried: /opt/homebrew/lib/php/pecl/20220829/xdebug.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file)), /opt/homebrew/lib/php/pecl/20220829/xdebug.so.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file))) in Unknown on line 0
[15:05:31.431] Calculate Anything[Script Filter] Warning: Failed loading Zend extension 'xdebug.so' (tried: /opt/homebrew/lib/php/pecl/20220829/xdebug.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file)), /opt/homebrew/lib/php/pecl/20220829/xdebug.so.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file))) in Unknown on line 0
{"items":[{"title":"79.99993474 oz","arg":"79.99993474","subtitle":"Action this item to copy this number to the clipboard","valid":true,"mods":{"cmd":{"valid":true,"arg":79.99993474,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":"79.99993474 oz","subtitle":"Action this item to copy this value with unit to the clipboard"}}}]}
[15:05:31.432] ERROR: Calculate Anything[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:
Warning: Failed loading Zend extension 'xdebug.so' (tried: /opt/homebrew/lib/php/pecl/20220829/xdebug.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file)), /opt/homebrew/lib/php/pecl/20220829/xdebug.so.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file))) in Unknown on line 0
{"items":[{"title":"79.99993474 oz","arg":"79.99993474","subtitle":"Action this item to copy this number to the clipboard","valid":true,"mods":{"cmd":{"valid":true,"arg":79.99993474,"subtitle":"Action this item to copy the amount with no format"},"alt":{"valid":true,"arg":"79.99993474 oz","subtitle":"Action this item to copy this value with unit to the clipboard"}}}]}

The notable error (pulled out from above):

[15:05:31.432] ERROR: Calculate Anything[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0. in JSON:
Warning: Failed loading Zend extension 'xdebug.so' (tried: /opt/homebrew/lib/php/pecl/20220829/xdebug.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so' (no such file)), /opt/homebrew/lib/php/pecl/20220829/xdebug.so.so (dlopen(/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file), '/opt/homebrew/lib/php/pecl/20220829/xdebug.so.so' (no such file))) in Unknown on line 0

System information:

  • OS: MacOS
  • Alfred Version 5.1.2 - Build 2145, Wednesday 2nd August 2023
  • PHP Version - php -v
PHP 8.1.21 (cli) (built: Jul  6 2023 16:08:36) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.21, Copyright (c) Zend Technologies
    with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans
    with Zend OPcache v8.1.21, Copyright (c), by Zend Technologies

Additional context
I have multiple installations of PHP, and I use Xdebug for work. It works fine in other projects. I'm not sure why it cannot be found in the php version that Alfred is using. But either way, it shouldn't be what is breaking Calculate Anything—I'm confused what is.

@biati-digital
Copy link
Owner

Hi, I'm afraid this is not related to the workflow and there's nothing I can do to help, you'll have to contact Alfred support, they should be able to help.

@jelias
Copy link
Author

jelias commented Aug 7, 2023

I'll reach out! Anything that clued you in to it being an Alfred issue, not a Calculate Anything issue?

@biati-digital
Copy link
Owner

Your Debug Output. it only mentions the error "Failed loading Zend extension 'xdebug.so". The workflow is basically a few PHP files that's it. Alfred is the one that executes the code, calls php, etc. So the problem is related to your PHP installation or the way Alfred is using one of your multiple PHP versions.

If it were a Calculate Anything error the debug output should display the files (in the workflow) where the error occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants