XF 2.1 Error cmd.php

mph

Active member
I want to enable Emojis in my forum. After the upgrade to XF 2.1 I forgot to convert the database to utf8mb4.
If I want to do this like it is described in the manual https://xenforo.com/xf2-docs/manual/unicode/ the command with the cmd.php doesn't run.
Code:
<b>Warning</b>:  Unexpected character in input:  '\' (ASCII=92) state=1 in <b>/homepages/32/d538953779/htdocs/chiliforum/cmd.php</b> on line <b>14</b><br />
Code:
<b>Parse error</b>:  syntax error, unexpected T_STRING in <b>/homepages/32/d538953779/htdocs/chiliforum/cmd.php</b> on line <b>14</b><br />
MySQL version 5.7.27
PHP 7.3.11
 

Chris D

XenForo developer
Staff member
The OP was likely executing cmd.php with a much older version of PHP.

php -v

Will tell you if you’re running the expected version.

Your web server may well be using a different PHP executable entirely which isn’t always what you would expect.
 
D

Deleted member 91401

Guest
The OP was likely executing cmd.php with a much older version of PHP.

php -v

Will tell you if you’re running the expected version.

Your web server may well be using a different PHP executable entirely which isn’t always what you would expect.

I host myself.

Issues I had was rectified by disabling EWR backup addon and Dbtech security addon.

Just re enabled them after the dB converted.
 

Chris D

XenForo developer
Staff member
If you got the exact error in the first post then these would not have been caused by those add-ons.

A parse error complaining about syntax in that file suggests a much older version of PHP was executing it.

If you were not having the exact error as the first post then you would have been better to post your own thread and include your own errors so that people can help you effectively.
 

Baby Community

Well-known member
I want to enable Emojis in my forum. After the upgrade to XF 2.1 I forgot to convert the database to utf8mb4.
If I want to do this like it is described in the manual https://xenforo.com/xf2-docs/manual/unicode/ the command with the cmd.php doesn't run.
Code:
<b>Warning</b>:  Unexpected character in input:  '\' (ASCII=92) state=1 in <b>/homepages/32/d538953779/htdocs/chiliforum/cmd.php</b> on line <b>14</b><br />
Code:
<b>Parse error</b>:  syntax error, unexpected T_STRING in <b>/homepages/32/d538953779/htdocs/chiliforum/cmd.php</b> on line <b>14</b><br />
MySQL version 5.7.27
PHP 7.3.11


I have the same problem

My mysql version is 10.3.22 (10.3.22-MariaDB)
 

Baby Community

Well-known member
I did it with export, manipulating the file and import in a new database. After this I changed to the new database. But I cannot explain the exact way, because it is some month ago.

how did you do it mister ?

database.png


I upgraded my server plesk panel mariadb server.
Server centos 7 can you have a suggestion? I will even process it and assign the error report to you.
 

Baby Community

Well-known member
Code:
[root@server ~]# cd /var/www/vhosts/bebekforum.net.tr/httpdocs/

[root@server httpdocs]# php /var/www/vhosts/bebekforum.net.tr/httpdocs/cmd.php xf:convert-utf8mb4

PHP 5.6.0 or newer is required. 5.4.16 does not meet this requirement. Please ask your host to upgrade PHP.


Will anyone guide me to update the php server?
 
D

Deleted member 91401

Guest
Code:
[root@server ~]# cd /var/www/vhosts/bebekforum.net.tr/httpdocs/

[root@server httpdocs]# php /var/www/vhosts/bebekforum.net.tr/httpdocs/cmd.php xf:convert-utf8mb4

PHP 5.6.0 or newer is required. 5.4.16 does not meet this requirement. Please ask your host to upgrade PHP.


Will anyone guide me to update the php server?

Are you self hosted or do you use a shared host? (I mean are you using a VPS or shared hosting).
 

Baby Community

Well-known member
My operations on the server for those with similar problems

Installing PHP 5.6 on CentOS 7
1. To install PHP 5.6, you have to install and enable EPEL and Remi repository to your CentOS 7 system using the commands below.

Code:
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

2. Next, install yum-utils which is an assortment of utilities that integrate with yum to enhance its default features, giving it more advanced package management options and also making it easier to use.

A few of its important features include manipulating repositories, enabling or disabling packages on the go and lots more, without any manual configurations.

Code:
# yum install yum-utils


3. One of the most important program provided by yum-utils is yum-config-manager, which you can use to active Remi repository as the default repository for installing various PHP versions. For example, if you want to install PHP 5.5, PHP 5.6 or PHP 7.2 on CentOS 7, just enable it and install as shown.

Code:
# yum-config-manager --enable remi-php55   [Install PHP 5.5]
# yum-config-manager --enable remi-php56   [Install PHP 5.6]
# yum-config-manager --enable remi-php72   [Install PHP 7.2]



4. Now that you’ve enabled selected versions of PHP, you can install PHP (here, we have chosen to install PHP 5.6) with all needed modules as follows

Code:
# yum-config-manager --enable remi-php56   [Install PHP 5.6]
# yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo


Code:
# php -v


What I did after this update was

Code:
 cd /var/www/vhosts/bebekforum.net.tr/httpdocs

Code:
php /var/www/vhosts/bebekforum.net.tr/httpdocs/cmd.php xf:convert-utf8mb4

Of course, we don't forget to write the following code to config.php.

Code:
$config['fullUnicode'] = true;

PHP related resource if you are using different server versions
https://www.tecmint.com/
 
Last edited:
Top