XF 2.0 Issues changing database to utf8mb4

mark_redballoon

New member
I am trying to allow emojis on my forum. I have followed the instructions in the documentation for upgrading an existing installation (https://xenforo.com/xf2-docs/manual/unicode/). This is what gets output when I run the command using SSH:

Code:
$ php cmd.php xf:convert-utf8mb4
Content-type: text/html

This script can only be run via the command line interface

I am unsure as to why this is occurring and need to know how to get the command to run. I haven't been able find any similar issues which other people have had running this command.
 
I've managed to resolve the issue.

When I tried to run
Code:
php -r 'echo php_sapi_name()."\n";'
I received this error:

Code:
Error in argument 1, char 2: option not found r
Usage: php-5.4 [-q] [-h] [-s] [-v] [-i] [-f <file>]
       php-5.4 <file> [args...]
  -a               Run interactively
  -b <address:port>|<port> Bind Path for external FASTCGI Server mode
  -C               Do not chdir to the script's directory
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -f <file>        Parse <file>.  Implies `-q'
  -h               This help
  -i               PHP information
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -q               Quiet-mode.  Suppress HTTP Header output.
  -s               Display colour syntax highlighted source.
  -v               Version number
  -w               Display source with stripped comments and whitespace.
  -z <file>        Load Zend extension <file>.
  -T <count>       Measure execution time of script repeated <count> times.

From the output I could see that when running php from the command line it was defaulting to php 5.4 rather than 7.1. I then ran the command again using 7.1:

Code:
$ php-7.1 -r 'echo php_sapi_name()."\n";'
cli

As this now worked I tried running
Code:
$ php-7.1 cmd.php xf:convert-utf8mb4
and that has now run the command.

Thanks S Thomas
 
Top Bottom