Getting Xdebug to work with Phpstorm/Chrome
Hello,
I have spent a fair few hours now following the documentation on installing xdebug for phpstorm, and how to configure.
However, I cannot get it to work, and have run out of documentation to read and stackoverflow questions to try. Please could someone assist me, I do not really know where to start. I appreciate you are probably going to need some more information from me first? Any help or guidance you can give would be greatly appreciated.
Many Thanks
Andrew
Please sign in to leave a comment.
Hi Andrew, first of all, here's a starting point if you're looking for debugging guides: https://www.jetbrains.com/phpstorm/documentation/debugging/
Next, please describe your environment including where your web server is. Describe where you're stuck at.
Run a phpinfo(); web page and share it.
Hi Dmitry, everything is running on my local machine, with Apache2. When I run the debugger, I get a PHP Fatal error printed to the console:
/usr/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /home/user/companyName/product/app/controllers/SysAdmin.php
PHP Fatal error: Uncaught Error: Class 'controllers\Controller' not found in /home/user/companyName/product/app/controllers/SysAdmin.php:40
Stack trace:
#0 {main}
thrown in /home/user/companyName/product/app/controllers/SysAdmin.php on line 40
Process finished with exit code 255
Hi Andrew, sorry for missing your reply. "PHP Fatal error" means there's an issue in your code that isn't related to IDE or debugging.
You'll receive the same error message if you just run your code on a web server.
Based on the message "Class 'controllers\Controller' not found in /home/user/companyName/product/app/controllers/SysAdmin.php:40" you should look into how exactly you're including your controller class in a SysAdmin.php. Try some of the suggestions from SO, e.g. mentioned in replies and comments here: https://stackoverflow.com/questions/8490667/php-class-not-found-but-its-included