Let's look at various situations related to the php extension. In general, such a file can easily be opened in Notepad, but it will not always be informative. If this is the result of a programmer’s work in PHP, then we will get a source file with scripts and commands for execution. If you downloaded something from the Internet - a movie, music or a web page - then you can also receive a PHP file.

Two ways to open a PHP document

Let's try to open a file with the .php extension in the first case (the file with the code). It is impossible to run or view the result of executing a file without a server. But this is not a big problem either. Installing a server will cause difficulties even for novice programmers. Instructions:

  1. We install the Denver package on the PC - local server and other tools for comfortable work with scripts in PHP in offline mode, without active access to the Internet at all. It can be downloaded from the official build.
  2. Then we take our file, call it filename.php, and place it in the web server folder.
  3. and in the line enter the path to the file.
  4. We observe the result of executing the code.

Read more about the second and third points of the instructions. We go to the directory “C:\WebServers\home”, here by default there is a folder called “test”. Now at your discretion: you can select this folder, you can create your own here (for example, 123). Go to the folder and create another one called “www”. Now we place our file “filename.php” into it. The full path to the file will be as follows: “C:\WebServers\home\123(or test)\www\filename.php”.

It is worth paying attention to the fact that you must create a www folder; you should not skip this point.

We launch Denver using the Run button. A message should appear in a black window command line that host 123 (test) has been added. If in version local server there are no icons, then look for them in “C:\WebServers\denwer\utils\”.

You should not change the default settings after installing Denver, everything is already debugged and configured, Magic, GD, FDPF and others modules are included.

If you are not involved in program development and you have a file with the extension .php, music, then feel free to try opening it in Notepad. You may receive an error. In this case, disable the download manager and try again. In other cases with high probability The saved page of the site from which you started downloading the movie/music, etc. will open in the browser. Those. instead of directly downloading the content, you saved it to HDD the page itself.

Programs for working with PHP files on different OSes

The most in a simple way viewing a php document means opening it in Notepad, as mentioned earlier.

IN Windows php The file can be opened in the following programs:

  • Notebook;
  • PHPEdit;
  • Notepad++;
  • Microsoft Wordpad;
  • EditPlus;
  • Any text editor;

PhpEdit - professional program, with which you can not only open, but also create entire projects in PHP.

We recommend paying special attention to the Notepad++ program, which is very convenient to use when it comes to editing source codes of programs and scripts. If you open a PHP file in Notepad++, the syntax will be automatically recognized and highlighted, there is the ability to collapse and expand code blocks, convenient search and advanced replacement functionality based on regular expressions– far from the full functionality of the useful options that this editor provides.

On Mac open in:

  • Bare Bones Software BBEdit;
  • TextEdit;
  • TextMate;
  • Another text editor convenient for you.
  • Gedit;
  • BlueFish;
  • Eclipse PHP Development Tools;
  • Any text editor.

So, we looked at several options for how to open a file with PHP extension. In the first case, you will have the opportunity to familiarize yourself with the result of such a script; the second is suitable for making changes and editing the script code itself.

We hope we helped you resolve your PHP file problem. If you don't know where you can download an application from our list, click on the link (this is the name of the program) - you will find more detailed information regarding the place from where to download the safe installation version required application.

What else could cause problems?

There may be more reasons why you cannot open a PHP file (not just the lack of a corresponding application).
Firstly- the PHP file may not be linked correctly (incompatible) with installed application for its maintenance. In this case, you need to change this connection yourself. For this purpose, click right button mouse over the PHP file you want to edit, click the option "To open with" and then select the program you installed from the list. After this action, problems with opening PHP file should disappear completely.
Secondly- the file you want to open may simply be damaged. In this case, it would be best to find a new version of it, or download it again from the same source (perhaps for some reason in the previous session the download of the PHP file did not finish and it could not be opened correctly).

Do you want to help?

If you have Additional Information about the PHP file extension, we will be grateful if you share it with users of our site. Use the form found and send us your information about the PHP file.

Files of this format contain the PHP programming language. You can open the php file with special software or in a browser window. In addition to files for website programming, there are three types of PHP extensions that are used in certain uncommon services. This is a Callisto PhotoParade slideshow, a working CreataCard file containing autosaves and a publishing file Microsoft programs Picture It! They are not that common, so the likelihood of encountering them is low. We will tell you below how to open a php file for web programming.

General description of the PHP format

Language PHP programming developed by Danish programmer Rasmus Reldorf in 1995. Two years after the release of the first version, Reldorf released an improved version. Every hundredth domain on the Internet began to use it. In 1998, the document was redone by Israeli programmers, who later continued to work on the project. Their version was called PHP 3.0. Today we are using version 7.0.0, released in 2015. The PHP language is in 6th place in popularity; Internet giants Facebook and Wikipedia are written in it.


The extension has a language without a specific purpose. It is most common when developing web applications and dynamic sites. The language owes its popularity to a wide selection of built-in and external development tools, compatibility with database management systems through additional modules, interaction with cookies and sessions, and so on.

The format is open source on the server. Sites based on such an engine analyze PHP files, create html page and sent to the browser. As a result, when viewing source code the user does not see the php code.

How and with what to open a php extension file

A php file is not as easy to open as an html file. There are two ways: software and browser. In two cases, you need an interpreter or special software, and it is important to note that launching php and opening it are not the same thing.


Open php in browser

To understand how to open a php file in a browser, it is important to understand the difference between php and html. The latter opens on the client side - that is, in the browser, and php - on the server. To run php, you need to either purchase a domain and work with php on it, or install a local server on your computer. Last method preferable because it is free and allows you to create an unlimited number of websites that are stored on your PC.

There are three main types of local servers:

After installing the local server on your computer, you need to create a website.

Then in the server folder you need to find a folder called “home”, create another one in it and name it as the domain of the future site. Next, create another folder and call it “www”, drag the necessary documents into it.


Next, launch the browser and address bar write the site name/php file name. After pressing “Enter”, php is launched as an application, not as text code. This allows you to test the interactive capabilities of the resulting page.

Open php on computer

There are many ways to open a php file on a computer. Since they open in text format, specialized code editors will be able to work with php.

Answers:

Pavel Elagin:
Why did you download the file if you don’t know how to open it?

Axel:
This is a file php language used on web servers. If you don’t know what it is, then believe me, there’s no point in launching it.

Forward:
Internet Explorer"om or any other Internet browser. PHP is a format for dynamic Internet pages.

Shurovik:
Alas, it's just a script. Obviously, the program you downloaded something with was unable to process the script correctly and downloaded this script instead of the required file. Try downloading what you are looking for again, but in a different way.

TU-154:
This is a script executed on the server side. That is, you downloaded the wrong thing - you had to download the result generated by this script.

Roman Gural:
PHP is an interpretable programming language that is used to build web pages. To run this file for execution you need a web server running on your computer. And so you can see the downloaded file, just open it with a text editor.

Spider:
It depends on how and where you downloaded it, if via FTP or from a server that does not support PHP, then this is a script (or part) in the PHP language. Then you can open it with any editor, for example, Notepad. If from a server that supports PHP, then this is a regular page generated by this script. Then - any browser

Kle:
Sometimes downloaders make mistakes and do not give files correct name. If Internet Explorer shows nonsense (it’s better not to open files larger than several hundred kilobytes), it makes sense to try opening it in WinRAR. At worst, attribute the extension to .exe (if you are not afraid to run unknown things on your computer).

Therodactel:
Dear sirs, think again about the meaning of the question. It is asked by a person completely far from WEB servers. I just tried to download a program or game from a link, and the browser transferred the download to the rocking chair. Disable browser downloader integration. Or download the same link using another browser. You'll probably end up on the Rapida or Deposit download page or something like that.