opulencephp/Opulence

Doesn't work on Windows

reemaadeniyi opened this issue · 18 comments

This doesn't work on Windows.

It requires a php extension ext-pcntl which is not available on Windows.

Could have let us know in the Readme

Strange. That seems to be due to PHPUnit using phpunit-invoker, which required ext-pcntl. As far as I can tell, Opulence does not require phpunit-invoker. So, I'll have to investigate why it's being used.

Does setting processIsolation="false" in phpunit.xml solve your problem?

<phpunit
        bootstrap="config/phpunit.php"
        processIsolation="false"
        colors="true">
    <testsuite name="Project">
        <directory>tests</directory>
    </testsuite>
    <php>
        <env name="ENCRYPTION_KEY" value="test"/>
    </php>
</phpunit>

Yes this seems to resolve the issue. Thanks for your fast response.
I actually removed the line requiring php-invoker in the composer file and it worked from there

Which composer file was requiring php-invoker? PHPUnit's? Does it work even with that line if you use processIsolation="false"?

I'm glad it's working for you!

So when I ran this command

composer create-project opulence/project --prefer-dist

It created a composer.json file in the project directory root requiring the php-invoker at line 30
I saw no phpunit.xml file before I ran the composer install command

The phpunit.xml file is created when you run composer create-project opulence/project --prefer-dist.

When I ran that command, this is what I see in composer.json. Is this not what you're seeing?

Hmmm strange. I got something different. I ran the command again in a new directory just to check and still the same output.

https://github.com/femiruby/opulence/blob/master/composer.json

Are you running PHP 7 on the machine you're using Composer from? Someone else had this issue, and it was because their local PHP was PHP 5, but their remote server was PHP 7. Both would need to be PHP 7.

Well I am running PHP 7 and I'm using it's fast cgi as my server through caddy so I believe both are using the same version. If it makes a difference, I've installed PHP through package manager Chocolatey but that shouldn't cause any issues.

The version of Opulence you installed is 1.0.0-alpha22, which was the last version that supported PHP 5.5. So, somewhere in your stack, I'm guessing you have PHP 5.5 or PHP 5.6 installed.

Hmmm I see. So how do I install the latest version because using the opulence/project create command seems to be the problem.

On the console you ran the create-project command, what is output when you run php -v?

Ok I think the answer would be to use
composer create-project opulence/project --prefer-dist --stability=dev
instead of
composer create-project opulence/project --prefer-dist

Having no problem using the first command

Actually another error appears
Script php -r "echo 'Important: make ' . __DIR__ . '/tmp writable ';" handling the post-create-project-cmd event returned with an error

And the php version displays as 7.0.8

And also thanks for your patience and continued assistance

Ohhh. Yeah, the official installation notes say to use --stability=dev because it's still in beta. That alpha22 was accidentally marked as a stable release, which it wasn't. The script you see there should've actually output something on the next line like Important: make /home/project/tmp writable (actual directory is different for you I'm sure).

And not a problem! It's nice to get feedback and know what's easy to do and what needs some explaining.

Ok right, that makes sense. Well everything seems to be working fine from here on. Just to add, the script actually displayed a runtime exception error in red, thought it doesn't look like it has serious effects.
github opulence composer

Though I entered the command manually after and it worked as expected.

Due to not installing with minimum stability set