How to Run Php in Sublime in Ubuntu Linux

  • Last updated: September 13, 2024 By Sunil Shaw

How to Run Php in Sublime in Ubuntu Linux

In this blog we will learn How to Run Php in Sublime in Ubuntu Linux step by step. I explained in two steps only. Lot’s of people seaching on google for further help, i found it out.

What is Sublime Text++

It is an Open Sources lite weighted code editor/IDE. It is made by C++ and Python, using cross platform technology. It’s an very light weight yet support all programming language mazorly and markup language. It is develop and design by Jon Skinner in early 2008. It doesn’t come with preloaded plugins and other tools developers use, which makes it very lightweighted and popular among learners.

How to Run Php in Sublime in Ubuntu Linux Step By Step

Step 1: Find PHP Path

which php
Find PHP Path

copy this php path and paste in sublime

Step 2: New build system in sublime

Go to tool -> Build System -> New Build System

New build system in sublime

Copy paste this into your file and save file with PHP name and extestion will be .sublime-build. e.g PHP.sublime-build

{ 
    "cmd": ["path/to/your/php", "$file"], 
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", 
    "quiet": true, 
    "selector": "source.php" 
} 

Here is my php path

{ 
    "cmd": ["/usr/bin/php", "$file"], 
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", 
    "quiet": true, 
    "selector": "source.php" 
} 

Step 3: Select PHP

After saving this close the sublime and restart the sublime and select the PHP form build system as shown below in image.

How to Run Php in Sublime in Ubuntu Linux Step By Step

If you want How to Create an Professional Blog Using Laravel PHP

If you want to download sublime go to Ubuntu Software and in search bar and click on install.

Step 4: Run PHP

Now start coding php script and press CTRL+B to execute

Adjust Color in Sublime

If you didn’t like built-in color you can change it. Follow bellow step to change your color scheme

  • Go to Prefernces
  • Select Color Scheme
  • Then choose name


Follow on:
Sunil Shaw

Sunil Shaw

About Author

I am a Web Developer, Love to write code and explain in brief. I Worked on several projects and completed in no time.

Related Articles

Popular Language Tutorials

If You want to build your own site Contact Us