0

I am trying to get Xdebug to work for a Laravel application in PhpStorm. I have Xdebug installed but not sure how to configure it in this instance. Usually the instance will run in Docker but I'm not sure what's best for development. I can see that Xdebug is installed when checked with phpinfo().

I am getting the error: PHP Parse error: syntax error, unexpected character 0x00, expecting end of file in /usr/bin/php8.3 on line 12424 even though the code works when run normally. Am I missing something?

I have PHP8.3 installed with the current Xdebug config in /etc/php/8.3/cli/php.ini

[xdebug]
zend_extension=/usr/lib/php/20230831/xdebug.so
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003

Configuration

Error

5
  • 4
    It looks to me like you are trying to run the interpreter (php8.3) as your script. Shouldn't the File under Configuration be the name of your PHP script? Commented Jan 14 at 4:30
  • Normally, it's called through Apache/Nginx but because that's done within the Docker container I'm not sure how to do it here. Actually, I think I am quite lost. It's been quite a few years since I've done PHP development. Commented Jan 14 at 5:24
  • 1
    "File" should be "artisan" (maybe full path to it, if not in PATH). The interpreter is set if the "Interpreter" drop-down. Laravel command-line tools do not run through a web server. Commented Jan 14 at 7:39
  • Here: how to debug Laravel's artisan commands: jetbrains.com/help/phpstorm/… (if that's what you are after -- probably not (after a second thought)) Commented Jan 14 at 9:21
  • A concrete question is missing. "Am I missing something?" does not qualify. Please consult the help center and edit your post accordingly. Commented Jan 15 at 2:09

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.