When developing with EC-CUBE3, encountering errors is inevitable. However, in many cases, when a system error occurs, the only message displayed on the screen is “A system error has occurred.” It can be challenging to identify the specific cause or location of the error, often delaying the resolution.
This is where the “debug mode” becomes a savior. Enabling debug mode allows you to see specific details about the error’s cause and location, significantly paving the way for problem-solving.
Incidentally, while I have created websites with EC-CUBE several times, I struggled considerably because I did not know how to use debug mode. Whenever an error occurred, I wasted a lot of time checking log files to investigate the cause. If only I could go back and teach my past self…
How to Use Debug Mode
There is a file named index_dev.php
in EC-CUBE3. You need to display this page.
[Standard URL example after EC-CUBE3 installation]
https://dad-union.com/ec/
[Debug Mode URL example after EC-CUBE3 installation]
https://dad-union.com/ec/index_dev.php
When you access the debug mode, a message such as “You are not allowed to access this file. Check index_dev.php for more information.” appears. Open the index_dev.php
file and add your IP address to the following section:
$allow = array(
'127.0.0.1',
'fe80::1',
'::1',
);
After adding your IP address:
$allow = array(
'127.0.0.1',
'fe80::1',
'::1',
'XXX.XX.XXX.XX', // ← Add your IP address here
);
You can check your current IP address on the following site:
Access Information [Check your current IP address] >>
How to View Product List and Detail Pages in Debug Mode
First, access the debug mode’s top page:
[Debug Mode TOP Page URL example]
https://dad-union.com/ec/index_dev.php
From this page, you can navigate to pages such as the product list:
[Debug Mode Product List Page URL example]
https://dad-union.com/ec/index_dev.php/products/list
By using this method, you can check the details of errors occurring on any page of the site and respond promptly.
Conclusion
When facing errors during development with EC-CUBE3, utilizing debug mode is extremely effective. I hope this article helps make your development process a little smoother. Development often involves trial and error, but mastering tools like this allows for more efficient and effective problem-solving.
※ Please use this information at your own discretion.