10

I have a computer with apache2 and php7, I setup the php.ini to use xdebug and its ok, I can debug using an editor.

But I want to debug in another computer that has only php.

I started the server using: php -S localhost:8080

I tried to use the same php.ini, but it seems that php built-in web server can't understant the php.ini

I used the command: php -S localhost:8080 -c <<path to my php.ini>>

Here the phpinfo output from apache server:

enter image description here

and here the output from built-in web server:

enter image description here

8
  • Why not use Kint? It's better than xdebug, and doesn't require being installed into the php distribution. Commented Nov 26, 2017 at 3:14
  • 1
    @Danilo I'm not sure why report_zend_debug option should matter here -- AFAIK it has no relation to xdebug at all. if anything -- you should be looking at xdebug specific section. P.S. PHP's built-in web server works fine with xdebug -- otherwise it would not be possible to use it with Laravel/Symfony that use it (by default in manuals) for local dev. Commented Nov 27, 2017 at 14:52
  • @LazyOne, Thanks very much for your contribution, I don't know if the php.ini was loaded, because if I give a wrong path then the built-in web server runs, but without issuing errors, I tried in many ways, using full path: php -S localhost:8080 -c c:/php/php7/php.ini, I copied the php.ini to the current directory and called: php -S localhost:8080 -c php.ini Commented Nov 27, 2017 at 16:17
  • 1
    @LazyOne, It works now, yes, phpinfo() shows me that xdebug is active, my problem was on notepad++ plugin and not on built-in web server, thanks very much. Commented Nov 28, 2017 at 12:57
  • 1
    @mopsyd because kint is not a debugger... Commented Sep 7, 2022 at 13:23

1 Answer 1

7

You need to pass php.ini before -S:

php -c /path/to/php.ini -S localhost:8080
Sign up to request clarification or add additional context in comments.

Comments

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.