jhavrda
jhavrda

Reputation: 395

How to run php code in gedit using External Tools plugin?

I've tried this code in External Tools with actual document as input. But it doesn't work.

#!/bin/sh
/usr/bin/php -r

Syntax check works as expected

#!/bin/sh
/usr/bin/php -l

Outputs either error message or "No syntax errors detected"

Upvotes: 1

Views: 2222

Answers (2)

ezraspectre
ezraspectre

Reputation: 3298

You can also one of the many Gedit keywords.

$$GEDIT_CURRENT_DOCUMENT_PATH
$GEDIT_CURRENT_DOCUMENT_URI

Upvotes: 1

Micah Carrick
Micah Carrick

Reputation: 10197

For the external tools, set the "Input" to "Current document" and the command is just php (no options):

php

The output in the bottom pane will be the output of your script. Just keep in mind that this is only going to work for local files.

Edit: screenshots...

enter image description here

Running PHP from Gedit

Upvotes: 2

Related Questions