Upgrading to xibo v2, unable to do database migrations

Hello,
my Xibo installation is running on XAMP 7.3 (Windows Server) and I want to upgrade to version 2.0.0.

When I run command “php vendor/bin/phinx migrate” I get this error:

PHP Warning: require(C:\xampp\htdocs\xibo\vendor\bin/…/app/phinx.php): failed
to open stream: No such file or directory in C:\xampp\htdocs\xibo\vendor\bin\phi
nx on line 27

Warning: require(C:\xampp\htdocs\xibo\vendor\bin/…/app/phinx.php): failed to op
en stream: No such file or directory in C:\xampp\htdocs\xibo\vendor\bin\phinx on
line 27
PHP Fatal error: require(): Failed opening required ‘C:\xampp\htdocs\xibo\vendo
r\bin/…/app/phinx.php’ (include_path=‘C:\xampp\php\PEAR’) in C:\xampp\htdocs\xi
bo\vendor\bin\phinx on line 27

Fatal error: require(): Failed opening required ‘C:\xampp\htdocs\xibo\vendor\bin
/…/app/phinx.php’ (include_path=‘C:\xampp\php\PEAR’) in C:\xampp\htdocs\xibo\ve
ndor\bin\phinx on line 27

I run this command in xibo root directory, please see attached image.

If I run this command in xibo\web\install folder, I get this error:

Could not open input file: vendor/bin/phinx

Primjedba%202019-03-20%20125234

What I am doing wrong?

The correct comand is

php vendor/bin/phinx migrate -c phinx.php

That should be run in the root of the install directory (where you find the vendor folder, and phinx.php)

I have tried that now, but get the same error.
Please see attached image:
Primjedba%202019-03-21%20094036

What version of PHP are you using?

I’m running PHP version 7.3.0.

Apparently on Windows you need to:

Download https://raw.githubusercontent.com/cakephp/phinx/master/bin/phinx.bat and save it in to the vendor\bin folder.

Then run instead

vendor\bin\phinx migrate -c phinx.php

Note also that you should not have the whole CMS source tree inside your htdocs folder. Hopefully you’ve set your webserver web root to be just the web folder inside the Xibo code.

We’ve not tested with PHP 7.3 yet so you may encounter issues in that regard too.

That didn’t work, but I have succefully solved it.

Here is how:

  1. Copy folder “app” from “vendor\robmorgan\phinx” to “vendor\bin”

  2. Copy folder “src” from “vendor\robmorgan\phinx” to “vendor\bin\app”

  3. In folder “vendor\bin” using Notepad edit file “phinx”:
    change line
    $app = require DIR . ‘/…/app/phinx.php’;

    to

    $app = require DIR . ‘/app/phinx.php’;

  4. In folder “vendor\bin\app” using Notepad edit file “phinx.php”:
    change line
    $autoloader = require DIR . ‘/…/src/composer_autoloader.php’;

    to

    $autoloader = require DIR . ‘/src/composer_autoloader.php’;

  5. Run this command: php vendor\bin\phinx migrate -c phinx.php

Couple of seconds later, migration is complete and I can login to my Xibo.

Now Xibo 2.0.0 is running with PHP 7.3 :slight_smile:

7 Likes

Have been scratching around this morning trying to come up with a way to upgrade from 1.8 to 2.0.4 on my custom IIS installation.

I had to login and thank you for uploading this solution. I followed your recommendation and my install immediately performed the upgrade.

Thank you very much!

To any Xibo developer/documentation writers, please include this as a solution to upgrading Xibo on Windows/IIS!

1 Like

I had to do this to upgrade to PHP 7.3.7 (XAMPP 3.2.4)
Append Path:
path = %path%c:\xampp\php;

copy vendor\robmorgan\app to xibo\vendor\bin
copy vendor\robmorgan\src to xibo\vendor\bin\app
copy phinx.bat to xibo\vendor

run :
vendor\bin\phinx migrate -c phinx.php

hello;
I installed xibo v2.0 and at the end of installation I received this message
image

I followed the steps above but nothing changed
help me plz

Good Job , thank you :wink:

this method don’t work for 2.2version

Are you sure?
I managed to upgrade from v2.1.2 to 2.2 using the same steps as I wrote above.

Be sure to check this too:

1 Like

i will try again, my php version is 7.0 it can be the problem ?

Can’t tell you because I haven’t test it on php 7.0.

thank’s oneill it’s work just i added two underscores on both sides of “DIR”

Great fix! Much thanks.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.