welovewordpress / SublimePhpTidy

Plugin for Sublime Text 2 to format PHP code to meet the WordPress Coding Standards using a modified version of phptidy
GNU General Public License v2.0
109 stars 30 forks source link

phppath problem at windows with xammp. #2

Closed Aqzhyi closed 12 years ago

Aqzhyi commented 12 years ago

My devel server is Windows 7 with XAMPP 1.7.7 portable version. And I using Sublime Text 2 with SublimePhpTidy.

When I using command "Tidy PHP"...

PhpTidy return a error "PhpTidy cannot find %s. Make sure it is available in your PATH."

The real xampp php.exe path is "F:\xampp\php\php.exe"

and sublime path is "F:\Dropbox\p\Sublime Text 2\"

But

I fixed it with edit "F:\Dropbox\p\Sublime Text 2\Data\Packages\PhpTidy\php_tidy.py" at Line 24

Line 24 : phppath = 'F:\xampp\php\php.exe'

It's a problem ?

welovewordpress commented 12 years ago

You should add the directory F:\xampp\php to your PATH variable so that you can actually type php.exe on the command line.

Editing the plugin like you did work for now - until there is an update which will overwrite your changes.

But I will keep this in mind and the next update will contain an user setting where you can set up a custom path to your php.exe. ;-)

Aqzhyi commented 12 years ago

I still got a error message "error: PhpTidy cannot find php.exe. Make sure it is available in your PATH."

PATH system variable

cmd php.exe

I have no idea on this :(

anyway, thank you for your reply.

Look forward to the new version!

It's really good plugin!

welovewordpress commented 12 years ago

Hi @marjoriezhou

I'm sorry if I didn't understand you correctly, but I was thinking that after your modification, it IS working for you.

Thank you for the screenshots, I see that your PATH variable seems to be set up right and that the error message ("...make sure it's in your PATH.") seems completely wrong. I will try to do me best, to fix that in the next version - but for now, let me ask again:

Does it work on your machine right now (after you changed line 24), or not?

Aqzhyi commented 12 years ago

It is work now!

It's work

Thank you for your help!