Running: Ubuntu 16.04 LTS (also happens on Debian Stretch) Magento 2.1.1 PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )

Magento installed and DB set up etc.

I run:

rm -rf var/di/* var/generation/* var/cache/* var/page_cache/* var/view_preprocessed/* var/composer_home/cache/*
chmod 777 var -R
chmod 777 pub -R
php -d memory_limit=2048M bin/magento setup:di:compile

Then I get the error:

Compilation was started.
Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 44.0 MiBPHP Fatal error:  Cannot use Cminds\Marketplace\Model\Fields as Fields because the name is already in use in /var/www/html/app/code/Cminds/Marketplace/Controller/Adminhtml/Suppliers/Deletecustomfield.php on line 7
Segmentation fault

On PHP 5.6.27 (cli) (built: Oct 23 2016 11:47:58) I do not get this error and compilation happens successfully.

  1. Does anyone know why the PHP version would cause this?
  2. Adding -vvv does nothing (as far as I can tell, no extra logging in /var/log), is there a way I can get more information relating to the error?

Any help would be much appreciated

  • 2
    Upgrade PHP, there was a bug in the earlier versions of 7.0.x causing this. – Daniel Sloof Dec 30 '16 at 11:07
  • Thanks a lot. I didn't realise the Ubuntu repos contain a buggy PHP release. I added ppa:ondrej/php and used his PHP release. Then it worked. Dankjewel Daniel ;) – Duncan Campbell Dec 30 '16 at 14:35
  • Not necessarily a PHP 7 bug. You could get segmentation fault errors if you have PHP code issues, too. See PHP error log to see if you're getting any PHP fatal errors. – musicliftsme Apr 12 '17 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.