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

Error creating project from composer #47

Closed
gildonei opened this issue Feb 7, 2022 · 11 comments
Closed

Error creating project from composer #47

gildonei opened this issue Feb 7, 2022 · 11 comments
Assignees
Labels
Bug Something isn't working
Milestone

Comments

@gildonei
Copy link
Contributor

gildonei commented Feb 7, 2022

Bug Report

Software Version
Windows 11 - Full Updated
PHP CLI 7.4.9

Summary

Trying to create a new empty project according project tutorial in https://api-tools.getlaminas.org/

Current behavior

composer create-project laminas-api-tools/api-tools-skeleton
....

> php -r 'if (file_exists("src/remove-package-artifacts.php")) include "src/remove-package-artifacts.php";'
Script php -r 'if (file_exists("src/remove-package-artifacts.php")) include "src/remove-package-artifacts.php";' handling the post-create-project-cmd event returned with error code 1

How to reproduce

In console run composer create-project laminas-api-tools/api-tools-skeleton, and use production config files, at the end of process the line errors above will be displayed
image

Expected behavior

Create a new project without errors

@gildonei gildonei added the Bug Something isn't working label Feb 7, 2022
@Ocramius
Copy link
Member

Ocramius commented Feb 7, 2022

What happens if you run php -r 'echo "hello";' in your terminal? Wondering if the CLI tools are referencing the wrong php binary, perhaps 🤔

@gildonei
Copy link
Contributor Author

gildonei commented Feb 7, 2022

I am using Win 11 with Wampserver 3.2.3

My php executable is in my system variables pointing to "C:\wamp64\bin\php\php7.4.9"

D:\Sites\apigility>php -r 'echo "hello";'

Parse error: syntax error, unexpected ''echo' (T_ENCAPSED_AND_WHITESPACE), expecting end of file in Command line code on line 1

@gildonei
Copy link
Contributor Author

gildonei commented Feb 7, 2022

D:\Sites\apigility>php -v
PHP 7.4.9 (cli) (built: Aug  4 2020 11:52:41) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

@Ocramius
Copy link
Member

Ocramius commented Feb 7, 2022

Something seems wrong about your system, IMO.

I'm unaware of how windows shell handles escaping, but over here:

~/Documents via ❄️  impure (nix-shell) 
❯ php -r 'echo "hello";'
hello

@gildonei
Copy link
Contributor Author

gildonei commented Feb 7, 2022

In Windows you have to double quote

D:\Sites\apigility\html>php -r "echo \"Teste\";"
Teste

@gildonei
Copy link
Contributor Author

gildonei commented Feb 7, 2022

In Windows you have to double quote

D:\Sites\apigility\html>php -r "echo \"Teste\";"
Teste

you can also use single quotes inside

D:\Sites\apigility\html>php -r "echo 'Teste';"
Teste

@Ocramius
Copy link
Member

Ocramius commented Feb 7, 2022

I wonder if that's the same error that's happening in the installer plugin? What happens if you run it with something like cygwin or similar shells?

@gildonei
Copy link
Contributor Author

gildonei commented Feb 7, 2022

Sorry, I can't reproduce it because I don't have a Linux instance running.

@gildonei
Copy link
Contributor Author

gildonei commented Feb 7, 2022

I forked project and tried to install using git clone and composer install, and it was installed without errors, but, when I tried to create a new Api, it said Api was created but nothing changed.

@Ocramius
Copy link
Member

Ocramius commented Feb 7, 2022

@Ocramius Ocramius closed this as completed Feb 9, 2022
@Ocramius Ocramius added this to the 1.7.0 milestone Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants