Start your own PHP scripts with php storm

Hello!

I want php scripts that are started with a batch file (Windows 7) on my php Storm. Can anyone help with a small tutorial?

Sincerely yours

Stephan

3 comments

Hi there,

So ... you want to execute php script from command line / batch script?

1) http://www.php.net/manual/en/features.commandline.usage.php
2) php.exe -h


For example

C:\PHP\php.exe -f C:\projects\myscript.php


Example with launching PhpStorm (e.g. launch.cmd)

C:\PHP\php.exe -f C:\projects\myscript.php
C:\PHP\php.exe -f C:\projects\my_another_script.php
cd "FULL\PATH\TO\PHPSTORM\INSTALL"
start PhpStorm.exe
@rem for example
@rem cd "C:\Program Files (x86)\JetBrains\PhpStorm\bin"
@rem start PhpStorm.exe
0

Can I to 'Tools -> Create Tool -> External Tools' use?
I want to use a batch file that changes the current script.
I would like to pass as a parameter the path to the current script.

tool.jpg

The script is to be updated after termination of employment.

Can anyone help with a small example?

Sincerely yours

Stephan

0
Can I to 'Tools -> Create Tool -> External Tools' use?

Yes, you can

I want to use a batch file that changes the current script.

You are welcome to use any program, be it batch script or jar/exe/etc -- as long as you provide correct parameters

I would like to pass as a parameter the path to the current script

Sure -- use $FilePath$ macro

The script is to be updated after termination of employment.

?? I do not understand this English, sorry.

Any External Tools is called manually.

Can anyone help with a small example?

Example of what? Please be more specific. How to configure External Tools to execute batch file? How to write batch script (what commands should be there)? Or you need PHP code that reads some file, makes some changes and writes them back to the same/another file?

0

Please sign in to leave a comment.