i cant run this command "php bin/magento setup:di:compile" it stops @ 14%
i have a magento2 - Dedicated Server and when i run di:compile i seee the below error
php bin/magento setup:di:compile
Compilation was started.
Repositories code generation...
1/7 [====>-----------------------] 14%
once it reach 14% is just stops?
i dont know how to reproduce the error .. it just happened?
Increase the memory limit.
Please try php -dmemory_limit=2G bin/magento setup:di:compile
@salehawal try to enable developer mode and display_errors. In your current report there is nothing to investigate as there is no error displayed.
@DanielRuf thanks .. already did didnt work ):
somtimes i see this error
The directory "public_html/generated/code/Magento" cannot be deleted Warning!rmdir(public_html/generated/code/Magento): Directory not empty
but when i re run it it goes, and when is starts to compile is stops @ 14% exactly
solved .. turns out to be a php code issue .. thanks all (:+1:
can you please elaborate , how did you resolved this issue.
Thanks.
i checked all the recently edited php files with my team, turns out that one of the files had a code error unde app/code/ .. the code issue was pure php the developer added code b4 namespace keyword so i commented it and run the command again and it works as expected
however to know where the problem was i had to do 2 things:
1- enable all errors to display on php.ini
2- run the command "bin/magento setup:di:compile" with show errors flag . not sure what was it i forgot i think it is '-rrr'?
all the best
Thanks for sharing your findings.
First one error on reporting for app/bootstrap.php file
use code
error_reporting(E_ALL);
ini_set('display_errors', 1);
Magento 2.3.1
after that run di:compile comand and find error.
Fatal error: Cannot use MagentoCatalogApiDataCategoryAttributeInterface as CategoryAttributeInterface because the name is already in use in vendor/magento/module-catalog/Controller/Adminhtml/Category/Save.php on line 12
comment line no:12,63
and run again di:compile command
Most helpful comment
First one error on reporting for app/bootstrap.php file
use code
error_reporting(E_ALL);
ini_set('display_errors', 1);
Magento 2.3.1
after that run di:compile comand and find error.
Fatal error: Cannot use MagentoCatalogApiDataCategoryAttributeInterface as CategoryAttributeInterface because the name is already in use in vendor/magento/module-catalog/Controller/Adminhtml/Category/Save.php on line 12
comment line no:12,63
and run again di:compile command