PHP Errors while updating

I’m not sure what previous version I had but it was about 2 years old. I updated with 1.5.9 and replaced the new folder with my previous folder via FTP. I followed the instructions and copied the ifconfig.php.example and did all that and I’m getting the following message now.

Really hope that all of my invoices, quotes, and data have not been lost.

A PHP Error was encountered

Severity: Notice

Message: Constant MB_ENABLED already defined

Filename: core/MY_Utf8.php

Line Number: 66

Backtrace:

File: /home2/njert/public_html/invoice/application/core/MY_Utf8.php
Line: 66
Function: define

File: /home2/njert/public_html/invoice/index.php
Line: 325
Function: require_once


Parse error: syntax error, unexpected '[' in /home2/njert/public_html/invoice/application/third_party/MX/Router.php on line 51
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home2/njert/public_html/invoice/vendor/codeigniter/framework/system/core/Exceptions.php:271)

Filename: core/Common.php

Line Number: 564

Backtrace:

A PHP Error was encountered

Severity: Parsing Error

Message: syntax error, unexpected '['

Filename: MX/Router.php

Line Number: 51

Backtrace:

Please read the wiki carefully. It states for upgrades from versions to 1.5.0:

  1. Then, delete everything in your InvoicePlane folder. Everything.

The file application/core/MY_Utf8.php is not present anymore in version 1.5.0 but is a left-over from a previous version. Delete it and try again.

This also applies to the second error in the file application/third_party/MX/Router.php which is not present anymore and should have been deleted.

Hi @Kovah, just confirming you want me to delete my entire directory of my installed InvoicePlane; ex www.website.com/invoice/ - deleting the “invoice” folder

No, not delete the entire folder now, just the

application/core/MY_Utf8.php file and the

application/third_party/MX/ directory

It returns with this. Since I still have the database file in phpMyAdmin is there a way delete the entire folder and somehow install the new folder to read from that old DB?

A PHP Error was encountered

Severity: Warning

Message: require(/home2/njert/public_html/invoice/application/third_party/MX/Router.php) [function.require]: failed to open stream: No such file or directory

Filename: core/MY_Router.php

Line Number: 7

Backtrace:

File: /home2/njert/public_html/invoice/application/core/MY_Router.php
Line: 7
Function: _error_handler

File: /home2/njert/public_html/invoice/application/core/MY_Router.php
Line: 7
Function: require

File: /home2/njert/public_html/invoice/index.php
Line: 325
Function: require_once

Fatal error: require() [function.require]: Failed opening required ‘/home2/njert/public_html/invoice/application/third_party/MX/Router.php’ (include_path=’.:/opt/php53/lib/php’) in /home2/njert/public_html/invoice/application/core/MY_Router.php on line 7
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home2/njert/public_html/invoice/vendor/codeigniter/framework/system/core/Exceptions.php:271)

Filename: core/Common.php

Line Number: 564

Backtrace:

A PHP Error was encountered

Severity: Compile Error

Message: require() [function.require]: Failed opening required ‘/home2/njert/public_html/invoice/application/third_party/MX/Router.php’ (include_path=’.:/opt/php53/lib/php’)

Filename: core/MY_Router.php

Line Number: 7

Backtrace:

Ah my bad, mistaken the MX directory with something else. You should restore the application/third_party/MX/ from the install package. Sorry.

@Kovah

Parse error: syntax error, unexpected '[' in /home2/njert/public_html/invoice/application/third_party/MX/Router.php on line 51
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home2/njert/public_html/invoice/application/third_party/MX/Router.php:51)

Filename: core/Common.php

Line Number: 564

Backtrace:

A PHP Error was encountered

Severity: Parsing Error

Message: syntax error, unexpected '['

Filename: MX/Router.php

Line Number: 51

Backtrace:

@Kovah will literally pay you to help me fix my FUBAR :expressionless:

I would suggest backing up the directory and starting with a clean install.
Then copy back the custom templates and uploads directory.

Please notice that paid support is not available.

@MGoldberg

The problem is in the file and line stated in your error message :

protected function _set_request($segments = [])

The use of arrays (’’) as default function argument values is not supported in earlier versions of PHP,

Upgrade to a newer version of PHP (I suspect 5.5 or 5.6 and above).

Alternatively remove those offending code. However, note that you may encounter errors elsewhere in your code.

// OLD : 
// protected function _set_request($segments = [])
// NEW
protected function _set_request($segments)