laravel - Debugging is not working in VS code. after upgrading php version from 7.2 to 7.4
Get the solution ↓↓↓I have upgraded my PHP version from 7.2 to 7.4 and I found that debugging has stopped in all projects.
My configurations are-
zend_extension="/usr/lib/php/20190902/xdebug.so"
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000
I have added the above configuration in the following files-
- /etc/php/7.4/apache2/php.ini
- /etc/php/7.4/apache2/conf.d/20-xdebug.ni
- /etc/php/7.4/cli/conf.d/20-xdebug.ni
- /etc/php/7.4/mods-available/xdebug.ini
php -v command is returning the following output-
PHP 7.4.14 (cli) (built: Jan 13 2021 08:04:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.14, Copyright (c), by Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
I have installed the Xdebug extension in VS code too-
phpinfo(); function is returning the following output-
How should I do to resolve my issue?
Answer
Solution:
PHP 7.4.14 (cli) (built: Jan 13 2021 08:04:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.14, Copyright (c), by Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
If you useXdebug
with version3
, you have to config again parameters. (https://xdebug.org/docs/upgrade_guide#Step-Debugging). Based on the shared documentation, I will suggest the following config:
zend_extension = "/usr/lib/php/20190902/xdebug.so"
xdebug.start_with_request = yes
xdebug.mode = debug
xdebug.client_host = 127.0.0.1
xdebug.log = /tmp/xdebug_remote.log
xdebug.client_port = 9000
xdebug.idekey = VSCODE
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: trying to access array offset on value of type null
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.