HI Guys,
Need some help. I am trying to migrate to V5 on self hosted server and hitting this issue:
While checking the logs.
[2021-09-29 06:18:41] production.INFO: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.4.0”. [] []
[2021-09-29 06:23:32] production.ERROR: ErrorException [0] : /home//public_html/invoices/app/Models/Account.php [Line 1126] => Unparenthesized a ? b : c ?: d is deprecated. Use either (a ? b : c) ?: d or a ? b : (c ?: d) {“context”:“PHP”,“user_id”:1,“account_id”:“1”,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36”,“locale”:“en”,“ip”:"****",“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“migration/auth”} []
But if I change the PHP to 7.4 then I am facing Whoops! Something went wrong. error.
[2021-09-29 08:07:29] production.ERROR: ErrorException [0] : /home/mydig100/public_html/invoices/app/Models/Account.php [Line 1126] => Unparenthesized a ? b : c ?: d is deprecated. Use either (a ? b : c) ?: d or a ? b : (c ?: d) (View: /home//public_html/invoices/resources/views/auth/login.blade.php) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“HEAD”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15”,“locale”:“en”,“ip”:"*",“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“login”} []
Thanks a lot for your help. I am able to get different versions of php under subdomain by adding the following code in .htaccess file. Hopefully, Helpful for some one:
Really Appreciate your help. Seems like I am getting somewhere. Now After the migration I can see the company in V5. Couple of issue I am facing here are:
There is a red flag in the V5 saying cronjobs needs to be enabled. I have checked the jobs table and it is empty. I have checked the cron job has been created by softaculous.
I tried to send an invoice (to myself using different email) and system says the invoice is queued successfully. It use to send the invoice straightaway in the old versions. - Just saw under Invoice activity, it says Address in mailbox given[] does not comply with RFC 2822,3.6.2.
2021-09-30 05:16:36] production.ERROR: There was an error generating the PDF with Phantom JS {“exception”:"[object] (App\Exceptions\PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /home/***/app/Utils/PhantomJS/Phantom.php:135)
After putting the following code and a little wait. PDF is back.
NINJA_HOSTED_PDF=true
PHANTOMJS_PDF_GENERATION=false
It can take up to 24 hours for message to be cleared. - What are these messages are for ? and why I can not send the invoice straightaway anymore ?
2> Are all of the email credentials in the .env file filled in and does the client have any email address? Yes I am using an email address which is correct and working fine in V4; I have also added email credentials in .env file according to the docs.
My Hosting provider has executed the “php artisan optimize” which has fixed the sending email issue.
Seems like I have come too close to fully functional app
The only thing I left with is red error about cron jobs. I have checked the docs and I am sure that I have the following command in cron jobs:
cd /home/***/invoices && /opt/alt/php74/usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1
but still that error is there.