I am using magento 2.1.5 when i change developer to production mode got the error like this

Enabled maintenance mode

Starting compilation

Something went wrong while compiling generated code. See the error log for details.

Command returned non-zero exit code:

/opt/remi/php70/root/usr/bin/php -f /www/sites/hostname/files/html/bin/magento setup:di:compile

so i running the following command

php bin/magento setup:di:compile

got the error like below

  Class Magento\Braintree\Model\Config\PayPal does not exist

2 Answers 2


I had faced such issue once. Please check file/folder name, Its case sensitive and should be exact or possible permission issue.

  • I didn't change any folder name and file. what permission should i give to solve the problem.
    – Jjo
    Commented Jul 4, 2017 at 9:58
  • Did you try running setup:upgrade before setup:di:compile? Commented Jul 4, 2017 at 10:34
  • Please check Magento documentation for file permission. If you are on local the 777 can do But just on local not on production. Commented Jul 4, 2017 at 10:35

Could you please check and change

/vendor/magento/module-braintree/Model/Paypal to


Change the Upper case for PayPal.Then Compile it.

  • it didn't work for me. again got same error [ReflectionException] Class Magento\Braintree\Model\Config\PayPal does not exist
    – Jjo
    Commented Jul 4, 2017 at 10:00
  • Could you pleas check the vendor folder for shortcut.php in the Braintree module. since it was working with the lowest version of Magento. but in latest they removed it
    – Suresh S
    Commented Jul 6, 2017 at 5:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.