fearless359 / simpleinvoices

Fearless359 SimpleInvoices beyond great beginnings
https://simpleinvoices.group
GNU General Public License v3.0
28 stars 7 forks source link

Getting blank page and nothing in apache's errors.log #81

Closed webcoder-eu closed 3 years ago

webcoder-eu commented 3 years ago

Hi,

I'm on Ubuntu 20.04 LTS and am trying to move SI from my Centos into this new instance. I've used both code bases 2019 and 2020. Unfortunately, after solving some config/custom.config.php.new and permissions problems, am getting a blank page when accessing SI and no errors are produced.

I'm on: Server version: Apache/2.4.41 (Ubuntu) Server built: 2020-08-12T19:46:17 PHP 8.0.2 MySQL Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu).

All neccessary modules installed and no complaints in the apache's error log file.

Many thanks in advance David

webcoder-eu commented 3 years ago

Ok, I see the problem

`$ composer update

Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:62 Deprecation Notice: Required parameter $path follows optional parameter $schema in /usr/share/php/JsonSchema/Constraints/UndefinedConstraint.php:108 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in /usr/share/php/Composer/Repository/RepositoryManager.php:130 Do not run Composer as root/super user! See https://getcomposer.org/root for details Loading composer repositories with package information Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2 Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1

redcuillin commented 3 years ago

I think the short answer is that SI doesn't support PHP 8+ yet. Given that it wasn't that long ago that it still didn't work with PHP 7, it's understandable, and 8 is still kind of 'bleeding edge' in many contexts. You're almost inevitably going to run into a lot of code that won't work with it in some very mainstream applications.

The easiest solution would be to downgrade to PHP 7.4. There's a good chance it's already installed on your machine, and you just need to change the version of PHP that your server is using (eg if you use Apache, 'sudo a2dismod php8.0' followed by 'sudo a2enmod php7.4' and then 'sudo service apache2 restart'). Since Ubuntu 20.04 doesn't provide PHP 8, I'm guessing you probably installed it via the Ondřej Surý PPA Repository. It's been very useful over the years, but I know it will automatically activate PHP 8, which is not ideal at the moment. Maybe in 6 months.

Re all the composer errors:

If you're just downloading to use SI and not to provide code changes, just install from the Zip (not git clone). I wouldn't think there's any need for you to run composer update, or even composer install. The download includes everything you need to run SI under PHP 7.4 already. In effect, 'composer install' has been run for you. If you really want the latest composer code, then run 'composer install --no-dev' to avoid installing PHPunit and triggering all those errors.

If you are not getting a 500 error in your browser, I'd suggest the lack of errors is probably that error_reporting is switched off in the php.ini file for PHP 8's apache module. Enabling error reporting will reveal where the problems are in PHP 8, if you actually want to try to make it work.

fearless359 commented 3 years ago

If you are installing fresh, use the 2020_master with PHP 7.4. If you are upgrading, you first need to load and run master_2019.2 so that required database update, foreign keys in particular, are applied. Then move to master_2020. This information is available to you on the simpleinvoices.group forum. The forum is also the best way to report issues, etc.

webcoder-eu commented 3 years ago

Hi,

Thank you for you patience, helpful answers and not calling me an idiot :)

I've not touched this stuff for a couple of years now and it was my mistake. As soon as composer was run the problem was obvious i.e. a compatibility issue with PHP 8.0. There are two ways of resolving it namely downgrading my PHP to supported version 7.4 or updating this code to make it compatible.

One thing I'm wondering about is database compatibility between all three versions? Has there been any significant changes (a simple yes/no will do before I dive in and do schemas comparision) and how keen are you, apart from making this app compatible with latest linux packages, on merging new features e.g. have added to my old SI an invoice number prefix that's set on each client? I got mine from https://github.com/simpleinvoices2/simpleinvoices which was made compatible with PHP 5.6.40 and am trying to assess work required to migrate over exisitng data.

Cheers, David

redcuillin commented 3 years ago

Hi David - I think @fearless359 has already answered your question. To get upgraded from the old version, install and run master_2019.2 to get your database upgraded properly, then upgrade to master_2020. However, as he also said, these sorts of support questions (and suggestions) are best asked at https://simpleinvoices.group/. Good luck!