skip to Main Content

So I’m trying to create a shopify php app using shopify api with this command:

shopify app create php

but it’s failed, returning me this error message:

An unexpected error occured.
To submit an issue include the stack trace.
To print the stack trace, add the environment variable SHOPIFY_CLI_STACKTRACE=1.

And nothing else. It’s useless as I don’t know what’s wrong with my command or system to fix, so I tried this:

shopify app create php SHOPIFY_CLI_STACKTRACE=1 or this shopify app create php --SHOPIFY_CLI_STACKTRACE=1

But still see the same error message without any further information. Perhaps the above environment variable should be added to somewhere else, not the cli command? Also, I can’t create php app, but creating node app is perfectly fine, if you know why, please tell me.

Any help is greatly appreciated, thank you!

3

Answers


  1. You should follow this steps:

    Step 1:

    install

    https://rubyinstaller.org/downloads/

    https://git-scm.com/downloads

    Step 2:

    1. right click My Computer or This PC then select Properties
    2. left click Advanced system settings
    3. click/open Advanced tab
    4. click Environmental Variables
    5. under ‘User variables for [username] click ‘New’
    6. then type SHOPIFY_CLI_STACKTRACE in the ‘Variable Name’
    7. and type 1 on the ‘Variable Value’
    8. under ‘System variables’ do the same as 6 & 7
      Step 3 using cmd type or copy+paste the text below: (source: https://shopify.dev/themes/tools/cli)

    gem install shopify-cli

    gem install wdm

    Login or Signup to reply.
  2. Take note that creating a Shopify App does not actually require this CLI command tool in the first place. It is merely a convenience, and no substitute for the knowledge involved in actually making an App. Perhaps after you have successfully made an App and thoroughly understand the layout, components, structure, and files that comprise an App would this tool be of some utility. Worrying about the state of the utility and why it bugs it seems really counter-intuitive. Report the bug to Shopify, leave the fixing to them, and make your PHP App regardless! In my experience, recently, it has taken weeks for them to fix bugs, time better spent working on actual App code, rather than fiddling with a Shopify tool.

    Login or Signup to reply.
  3. In case this helps anyone else, I ran into the same issue initialising a new PHP project on Ubuntu this morning. The last line in the stack trace was

    1: from /var/lib/gems/2.7.0/gems/shopify-cli-2.7.1/lib/shopify_cli/services/app/create/php_service.rb:59:in `new’

    and then down into Semantic::Version. I’m not sure why this is throwing up a full stacktrace rather than the intended friendly error message, but it helped find the problem.

    This line is where the script checks that the local PHP version is >= 7.3 – I was running 7.2 locally. Upgrading to 7.4 fixed the issue, and the project was created successfully.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search