Can I use sublime to write php?
We can create a PHP build system in Sublime Text 3, so that it can be run quickly using the Ctrl+B command.
Set the PHP program to the environment variable, and php can be executed in any directory;
Enter sysdm.cpl through win R to open the system properties (you can also right-click on the computer -> Properties->Advanced System Configuration), select Advanced->Environment Variables, and then set the PHP executable program path to the environment variable path.
Related recommendations: "sublime introductory tutorial"
Pay attention to the use of semicolons. Separate each path with a semicolon. Note that it is an English semicolon. It is not a Chinese semicolon; check whether the php command can be used normally:
Create PHP compilation system
Add PHP build system, as shown in the figure, Tools-> ;Build System-> New Build System:
Create a new one. The default content is:
{ "shell_cmd": "make"} 修改为: { "cmd": ["php", "$file"], "file_regex": "php$", "selector": "source.php" }
Just save it in the default directory. Please change the file name to php.sublime-build .
Restart sublime text, you can use Ctrl B to compile the .php file; test
Just type some php code, ctrl B. If the PHP compilation system is set to ok, PHP can be compiled normally.
The above is the detailed content of Can I use sublime to write php?. For more information, please follow other related articles on the PHP Chinese website!