1

This is my first time trying out Magento 2 and I tried creating a basic custom module, but when I tried to execute the php bin/magento setup:upgrade it, I got an error:

Parse error: syntax error, unexpected ''Jurgis_Twilio'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in C:\wamp64\www\magento2\app\code\Jurgis\Twilio\registration.php on line 4

C:\wamp64\www\magento2\app\code\Jurgis\Twilio\registration.php:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Jurgis_Twilio',
    __DIR__
);

my php version (php -v):

PHP 7.0.10 (cli) (built: Aug 18 2016 09:48:53) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
3
  • have you craeted composer.json file Commented Jun 13, 2017 at 11:22
  • hmm, no. The tutorial I was following didn't say anything about that... Commented Jun 13, 2017 at 11:23
  • You need to check your custom module basic files and directories proper or not. and also check module name within code. inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2 Commented Jun 13, 2017 at 11:27

1 Answer 1

4

I cannot explain this, but the error was fixed by just rearranging the elements in one line like this:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(\Magento\Framework\Component\ComponentRegistrar::MODULE, 'Jurgis_Twilio', __DIR__);
1
  • @ErSarveshVTiwari :) Commented Dec 20, 2017 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.