TwenteMaster
TwenteMaster

Reputation: 158

how to check if there is xdebug installed on the server?

I'm using phpstorm to develop moodle for my company, the moodle is on the company's server, how do I check if there is xdebug installed on the server. If not, how to install it? If yes, how to configure phpstorm and how to debugging? Thanks!

Upvotes: 0

Views: 6897

Answers (1)

Ian
Ian

Reputation: 12241

Ideally you are developing on a local copy of the company's Moodle installation, and not directly in production. One very helpful tool for this is Vagrant, which helps with managing virtual machines. You would create a local version of your web hosting environment that matches your production hosting environment as closely as possible, with the exception of additional development tools installed, such as xdebug.

If you do have to develop on production, you can check if xdebug is installed by trying two things depending on your access to the machine.

  1. SSH: at the server's command line, run php -i | grep xdebug . If the server has xdebug installed, you will see some config output.

  2. phpinfo(): if you can't ssh in but you can run code in production, create a page that executes the php function phpinfo(); only, then visit that page. You will see a dump of all php config info. Do a find with your browser's search for xdebug, and if you see anything, then it is installed. It may not be enabled but that's a different question which you should get used to Googling for.

As far as phpstorm and xdebug goes, follow the documention and it will probably work assuming your server is set up as required. The problem with working in production on machines you don't control is that you probably won't have the access you need to configure things as needed, beyond the fact that developing on production is just a bad idea in the first place.

I highly recommend setting up a local dev environment with Vagrant.

Upvotes: 3

Related Questions