magento2 cron 不重建索引

magento2 cron not reindex

我在 Ubuntu 服务器和 Plesk 12.5 中使用此命令创建了一个 crontab :

MAILTO=""
SHELL="/bin/bash"
*/1 *   *   *   *   php -c -f /var/www/vhosts/system/domainname.com/etc/php.ini /var/www/vhosts/domainname.com/httpdocs/store/bin/magento cron:run > /var/www/vhosts/domainname.com/httpdocs/store/var/log/magento.cron.log&
MAILTO=""
SHELL="/bin/bash"
*/1 *   *   *   *   php -c -f /var/www/vhosts/system/domainname.com/etc/php.ini /var/www/vhosts/domainname.com/httpdocs/store/update/cron.php > /var/www/vhosts/domainname.com/httpdocs/store/var/log/update.cron.log&
MAILTO=""
SHELL="/bin/bash"
*/1 *   *   *   *   php -c -f /var/www/vhosts/system/domainname.com/etc/php.ini /var/www/vhosts/domainname.com/httpdocs/store/bin/magento setup:cron:run > /var/www/vhosts/domainname.com/httpdocs/store/var/log/setup.cron.log&

当 运行 时,它会创建三个文件 (magento.cron.log;update.cron.log;setup.cron.log)。三个文件包含相同的文本:

; ATTENTION! ; ; DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, ; SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

[PHP] soap.wsdl_cache_limit = 5 cli_server.color = On mysql.allow_persistent = On mysqli.max_persistent = -1 mysql.connect_timeout = 60 session.use_only_cookies = 1 register_argc_argv = Off mssql.min_error_severity = 10 open_basedir = "/var/www/vhosts/mydomainname.com/:/tmp/" session.name = PHPSESSID mysqlnd.collect_statistics = On session.hash_function = 0 session.gc_probability = 0 log_errors_max_len = 1024 mssql.secure_connection = Off pgsql.max_links = -1 variables_order = "GPCS" ldap.max_links = -1 sybct.allow_persistent = On max_input_time = 60 odbc.max_links = -1 session.save_handler = files session.save_path = "/var/lib/php5" mysqli.cache_size = 2000 pgsql.auto_reset_persistent = Off error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT auto_prepend_file = sybct.min_client_severity = 10 pgsql.max_persistent = -1 auto_globals_jit = On soap.wsdl_cache_ttl = 86400 allow_url_fopen = On zend.enable_gc = On mysqli.allow_persistent = On tidy.clean_output = Off display_startup_errors = Off user_dir = session.cookie_lifetime = 0 mysqli.max_links = -1 default_socket_timeout = 60 session.serialize_handler = php session.hash_bits_per_character = 5 unserialize_callback_func = pdo_mysql.cache_size = 2000 default_mimetype = "text/html" session.cache_expire = 180 max_execution_time = 30 mail.add_x_header = On upload_max_filesize = 2M ibase.max_links = -1 zlib.output_compression = Off ignore_repeated_errors = Off odbc.max_persistent = -1 file_uploads = On ibase.max_persistent = -1 mysqli.reconnect = Off mssql.allow_persistent = On mysql.max_persistent = -1 mssql.max_links = -1 session.use_trans_sid = 0 mysql.default_socket = always_populate_raw_post_data = -1 mysql.max_links = -1 odbc.defaultbinmode = 1 sybct.max_persistent = -1 output_buffering = 4096 ibase.timeformat = "%H:%M:%S" doc_root = log_errors = On mysql.default_host = default_charset = "UTF-8" request_order = "GP" display_errors = Off mysqli.default_socket = mysqli.default_pw = html_errors = On mssql.compatibility_mode = Off ibase.allow_persistent = 1 sybct.min_server_severity = 10 mysql.allow_local_infile = On post_max_size = 8M asp_tags = Off memory_limit = 512M short_open_tag = Off SMTP = localhost precision = 14 session.use_strict_mode = 0 session.gc_maxlifetime = 1440 allow_url_include = Off mysqli.default_host = mysqli.default_user = session.referer_check = pgsql.log_notice = 0 mysql.default_port = pgsql.ignore_notice = 0 mysql.trace_mode = Off ibase.timestampformat = "%Y-%m-%d %H:%M:%S" engine = On odbc.allow_persistent = On ibase.dateformat = "%Y-%m-%d" track_errors = Off max_file_uploads = 20 pgsql.allow_persistent = On session.auto_start = 0 auto_append_file = disable_classes = pdo_mysql.default_socket = mysql.default_password = url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" smtp_port = 25 sql.safe_mode = Off session.cookie_path = / expose_php = On report_memleaks = On session.gc_divisor = 1000 mssql.max_persistent = -1 serialize_precision = 17 odbc.check_persistent = On sybct.max_links = -1 mysqlnd.collect_memory_statistics = Off session.cookie_domain = session.cookie_httponly = session.cache_limiter = nocache enable_dl = Off mysqli.default_port = 3306 disable_functions = odbc.defaultlrl = 4096 soap.wsdl_cache_enabled = 1 soap.wsdl_cache_dir = "/tmp" mssql.min_message_severity = 10 session.use_cookies = 1 mysql.default_user = mysql.cache_size = 2000 implicit_flush = Off ignore_repeated_source = Off bcmath.scale = 0

但是当我进入洋红色管理器时,一直显示消息 "One or more indexers are invalid. Make sure your Magento cron job is running."

我不明白。什么是不起作用?

谢谢

flags for php 错了。应该是

*/1 *   *   *   *   php -c /var/www/vhosts/system/domainname.com/etc/php.ini -f /var/www/vhosts/domainname.com/httpdocs/store/bin/magento cron:run > /var/www/vhosts/domainname.com/httpdocs/store/var/log/magento.cron.log&

同时提供 php 的完整路径,可以通过 which php 命令找到。