Best Way to migrate to V5

Very weird,

this is the error message i get
“Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.4.0”.”

however i checked my composer.json file and it says require php >=7.3

not sure where else i should be look ? any idea ??

Note: i am using apache and my virtual host root folder /var/www/html/ninja5/public not sure if this is the correct path or not, but i copied what i had for v4. I have the extracted files inside the /var/www.html/ninja5 folder.

from my apache error logs found the following

[Mon Dec 07 10:25:18.536646 2020] [php7:error] [pid 373098] [client 10.1.1.70:57609] PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.4.0”. You are running 7.3.24-3+ubuntu20.04.1+deb.sury.org+1. in /var/www/html/ninja5/vendor/composer/platform_check.php on line 24

when i check the platform_check.php it is mentioned there that php >=7.4.0

Changing this value just change the error message. but doesn’t fix the issue

What happens when you run this command in the Invoice Ninja folder:

composer check-platform-reqs

Long output in red here you are a first part of it:

“Unknown package has no name defined ([{“name”:“asgrim/ofxparser”,“version”:“1.2.2”,“version_normalized”:“1.2.2.0”,“source”:{“type”:“git”,“url”:“https://
github.com/asgrim/ofxparser.git",“reference”:“a7cc813eed19df612fc58bbe9fc89837ed98b3bf”},“dist”:{“type”:“zip”,“url”:"https://api.github.com/repos/asg
rim/ofxparser/zipball/a7cc813eed19df612fc58bbe9fc89837ed98b3bf”,“reference”:“a7cc813eed19df612fc58bbe9fc89837ed98b3bf”,“shasum”:”"},“require”:{“php”:"~5
.6|~7.0"},“require-dev”:{“phpunit/phpunit”:"~5.5",“squizlabs/php_codesniffer”:"~2.6"},“time”:“2018-10-29T10:10:13+00:00”,“type”:“library”,“installation-s
ource”:“dist”,“autoload”:{“psr-0”:{“OfxParser”:“lib/”}},“notification-url”:“https://packagist.org/downloads/",“license”:[“MIT”],“authors”:[{“name”:"Gu
illaume Bailleul",“email”:"contact@guillaume-bailleul.fr”,“homepage”:“http://www.guillaume-bailleul.fr”},{“name”:“James Titcumb”,“email”:“hello@jamestitc
umb.com”,“homepage”:“http://www.jamestitcumb.com/"},{“name”:"Oliver Lowe",“email”:"mrtriangle@gmail.com”}],“description”:“Simple OFX file parser”,“keywo
rds”:[“finance”,“ofx”,“open financial exchange”,“parser”],“support”:{“issues”:“https://github.com/asgrim/ofxparser/issues",“source”:"https://github.
com/asgrim/ofxparser/tree/master”},“abandoned”:true,“install-path”:"…/asgrim/ofxparser"},{“name”:“authorizenet/authorizenet”,“version”:“2.0.0”,“ver
sion_normalized”:“2.0.0.0”,“source”:{“type”:“git”,“url”:“https://github.com/AuthorizeNet/sdk-php.git",“reference”:"7fa78e6397d363296e462c3b348573c17175
b7a8”},“dist”:{“type”:“zip”,“url”:“https://api.github.com/repos/AuthorizeNet/sdk-php/zipball/7fa78e6397d363296e462c3b348573c17175b7a8",“reference”:"
7fa78e6397d363296e462c3b348573c17175b7a8”,“shasum”:""},“require”:{“ext-curl”:"",“ext-json”:"",“php”:">=5.6"},“require-dev”:{“phpmd/phpmd”:"~2.0",“phpuni
t/phpunit”:"~4.0"},“time”:“2019-01-14T13:32:41+00:00”,“type”:“library”,“installation-source”:“dist”,“autoload”:{“classmap”:[“lib”]},“notification-url”:“ht
tps://packagist.org/downloads/”,“license”:[“proprietary”],“description”:“Official PHP SDK for Authorize.Net”,“homepage”:“http://developer.authorize.n
et”,“keywords”:[“authorize.net”,“authorizenet”,“ecommerce”,“payment”],“support”:{“issues”:“https://github.com/AuthorizeNet/sdk-php/issues",“source”:"h
ttps://github.com/AuthorizeNet/sdk-php/tree/master”},“install-path”:"…/authorizenet/authorizenet"},{“name”:“aws/aws-sdk-php”,“version”:“3.166.2”,
“version_normalized”:“3.166.2.0”,“source”:{“type”:“git”,“url”:“https://github.com/aws/aws-sdk-php.git",“reference”:"fe0ec9235d07b0f51ec4396dce0dd639020
ae1a7”},“dist”:{“type”:“zip”,“url”:“https://api.github.com/repos/aws/aws-sdk-php/zipball/fe0ec9235d07b0f51ec4396dce0dd639020ae1a7",“reference”:"fe0e
c9235d07b0f51ec4396dce0dd639020ae1a7”,“shasum”:""},“require”:{“ext-json”:"",“ext-pcre”:"",“ext-simplexml”:"",“guzzlehttp/guzzle”:"^5.3.3|^6.2.1|^7.0","
guzzlehttp/promises":"^1.0",“guzzlehttp/psr7”:"^1.4.1",“mtdowling/jmespath.php”:"^2.5",“php”:">=5.5"},“require-dev”:{“andrewsville/php-token-reflection
“:”^1.4”,“aws/aws-php-sns-message-validator”:"~1.0",“behat/behat”:"~3.0",“doctrine/cache”:"~1.4",“ext-dom”:"
",“ext-openssl”:"",“ext-pcntl”:"",“ext-so
ckets”:"*",“nette/neon”:"^2.3",“paragonie/random_compat”:">= 2",“phpunit/phpunit”:"^4.8.35|^5.4.3",“psr/cache”:"^1.0",“psr/simple-cache”:"^1.0",“sebas
tian/comparator”:"^1.2.3"},“suggest”:{“aws/aws-php-”

Not sure what is the packages he is talking about.

Here you are a part that says requires php 7.4
,{“name”:“spatie/browsershot”,“version”:“3.41.0”,“version_normalized”:“3.41.0.0”,“source”:{“type”:“git”,“url”:“https://github.com/s
patie/browsershot.git”,“reference”:“2cc87d4dad788b372549cf856c773a7e5a8fcace”},“dist”:{“type”:“zip”,“url”:“https://api.github.com/repos/spatie/browse
rshot/zipball/2cc87d4dad788b372549cf856c773a7e5a8fcace”,“reference”:“2cc87d4dad788b372549cf856c773a7e5a8fcace”,“shasum”:""},“require”:{“php”:"^7.4|^8.0",
“spatie/image”:"^1.5.3",“spatie/temporary-directory”:"^1.1",“symfony/process”:"^5.0"},“require-dev”:{“phpunit/phpunit”:"^9.0",“spatie/phpunit-snapshot
-assertions”:"^4.2.3"},“time”:“2020-11-18T08:51:42+00:00”,“type”:“library”,“installation-source”:“dist”,“autoload”:{“psr-4”:{“Spatie\Browsershot\”:“src”}
},“notification-url”:“https://packagist.org/downloads/",“license”:[“MIT”],“authors”:[{“name”:"Freek Van der Herten”,“email”:“freek@spatie.be”,"homepage
":“https://github.com/freekmurze",“role”:"Developer”}]

When i run the command on the old v4 directory i get different response:

gwadmin@websrv:/var/www/html/ninja$ composer check-platform-reqs
ext-curl 7.3.24 success
ext-dom 20031129 success
ext-fileinfo 7.3.24 success
ext-gd n/a invoiceninja/invoiceninja requires ext-gd (*) missing
ext-gmp 7.3.24 success
ext-hash 7.3.24 success
ext-iconv 7.3.24 success
ext-json 1.7.0 success
ext-mbstring 7.3.24 success
ext-openssl 7.3.24 success
ext-pcre 7.3.24 success
ext-SimpleXML 7.3.24 success
ext-SPL 7.3.24 success
ext-tokenizer 7.3.24 success
ext-xml 7.3.24 success
ext-xmlreader 7.3.24 success
ext-xmlwriter 7.3.24 success
ext-zip 1.15.4 success
lib-libxml 2.9.10 success
php 7.3.24 success

from one of the forum i found that i didn’t run the following command:

php /usr/bin/composer install --no-dev

When i run this command i am getting the following error :slight_smile:
Problem 1
- spatie/browsershot 3.41.0 requires php ^7.4|^8.0 -> your PHP version (7.3.24) does not satisfy that requirement.
- spatie/browsershot 3.41.0 requires php ^7.4|^8.0 -> your PHP version (7.3.24) does not satisfy that requirement.
- Installation request for spatie/browsershot 3.41.0 -> satisfiable by spatie/browsershot[3.41.0].

The original guide from invoice ninja didn’t mention this step though. Not sure which guide i should follow for my installation now


or
https://invoiceninja.github.io/selfhost.html#server-requirements

@gerootech you are correct. It appears the latest version of Browsershot upgrades their requirements to 7.4

I think we can wind back to Browsershot 3.40.2 which supported 7.1 without any pain.

Tagging @hillel and @ben for reference.

@david @hillel @ben Is there a specific version that i can use that uses Browsershot 3.40.2 ?? or will you be able to provide a quick update to fix this ??

@gerootech it’ll be in the next release, if you can’t wait that long… edit the composer.json file and set the line with browsershot to

3.40.2

Then you’ll just need to run composer update and you will be back in action :slight_smile:

@david i update my json file and ran php /usr/bin/composer update, and it gives me killed after a while,

When i try install --no-dev it give me the same dependencies as if i didn’t change the browsershot version to 3.40.21 in the composer.json file.

Note: I have 2 composer versions in my server and i am sorry i am not a developer so i am trying to figure out things but sometimes it is hard for me to understand why the steps required or how things should work.

I have one composer located at /usr/local/bin (v 1.7.3 - This one most probably from ubuntu 1804 as i have upgraded recently to ubuntu 20.04) and the other /user/bin (v 1.10.1) - I have just renamed the older version for now to make sure i am not confused. as when i run just composer it was picking the 1.7.3 version.

@gerootech I think you will need to upgrade composer to V2

composer self-update --2

Finally i managed to get V5 working, thanks for all the help, i will test the migration and will keep you guys posted.

Is there a way to move the white label as well ??

1 Like

Awesome! If you have the license you can apply it on Settings > Account Management

@hillel Thanks, and by the way i am using local domain (cannot get a public trusted cert) and was hoping that i can switch to SSL, however the android app still complaining about the selfcert for v5.

I was hoping this would be fixed in V5 though.

This isn’t broken, all versions of the mobile app require a trusted cert. We suggest using Let’s Encrypt.

@hillel i am using a trusted cert but not public trusted cert, the CA signed the cert is trusted by my phone, i believe you mentioned to me in another conversation that the mobile app is using it is own store for trusted cert and doesn’t leverage the phone.

When i access the browser using https it doesn’t complain about it because it is being trusted by my computer.

Also i remember you advised me to test v5. The problem i am using the application with a local domain name that i cannot generate a letsencrypt cert for it.

I am referring to this topic:

Right, I remember now.

@david what do you think, should there be an option in the mobile app to allow an untrusted cert?

@gerootech to make this work, you may need to add the root CA that you used to create the self signed certificate to your phones SSL store. The trust issue occurs well outside the bounds of the application so there isn’t anything for us to fix.

@david It is already added to the root cert of my phone but still getting the error invalid handshake. I have other applications (bitwarden) using the same CA with no issues.

When i try the new invoice ninja v5 on my android phone i get the following error:

HandshakeException: Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:354))

@gerootech right, so the app isn’t prompting to trust the cert.

@hillel to make this work, we’d need to ask the app to dive in and prompt to trust the cert, unsure how difficult this would be cross platform in flutter.

https://developer.android.com/training/articles/security-ssl#CommonProblems