S
S
scottparker2020-04-30 02:21:11
PHP
scottparker, 2020-04-30 02:21:11

How to fix error when running php script via terminal?

Greetings.
You need to add a cron script. Before adding, I want to check the script's performance by running it manually through the terminal. On startup - error:
syntax error, unexpected '?' (0)
/var/www/www-root/data/www/upping.bfdev.ru/bitrix/modules/main/classes/general/usertype.php:3105
#0: require_once
/var/www/www-root/data/www/upping.bfdev.ru/bitrix/modules/main/include.php:229
#1: require_once(string)
/var/www/www-root/data/www/ upping.bfdev.ru/bitrix/modules/main/include/prolog_before.php:14
#2: require(string)
/var/www/www-root/data/www/upping.bfdev.ru/parser/kufar/parseLink.php:10
[email protected]:/var/www/www-root/data/www/upping.bfdev.ru /parser/kufar#

if run through a browser - the script works properly, what could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shved, 2021-02-12
@shvedan1

Check which version the site uses for work and which version is used by default when calling their console script.
Probably, when running through the console, you need to explicitly specify that the same version of php that the site uses is used.
An example of a command on one of the projects:

/opt/php71/bin/php /var/www/www-root/data/www/{Домен проекта}/type_update.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question