In this article we will learn what .php files are, how to open them and how to work with them.

Files with the PHP extension are PHP source code files that contain hypertext preprocessor code. They are often used as web page files that generate HTML from a PHP engine located on the server.

The PHP engine creates HTML content from the code that we see in the browser. Since the program code runs on the server, when we go to a PHP page, we do not get access to the code itself, but only to the HTML content that the server generates.

Note

Some PHP source code files use a different extension, such as PHTML, PHP3, PHP4, PHP5, PHP7, or PHPS.

How to open PHP files

PHP files are text documents, so you can open them by anyone text editor or in the browser. IN operating system Windows will not have a question about how to open a PHP file. To do this, you can use the Notepad editor. But when writing PHP code, it is convenient when the syntax is highlighted, so it is better to give preference to a specialized editor.

Notepad++ is a free text editor with syntax highlighting. Here are some more editors for PHP: Adobe Dreamweaver, Eclipse PHP Development Tools , Zend Studio , phpDesigner , EditPlus and WeBuilder . These programs can edit PHP files, but cannot run the code. This requires other applications such as Apache Web Server.

Note

Some PHP files may actually be multimedia files or images that accidentally included the .PHP extension in their name.

In such a case, change the file extension before opening PHP in the desired program. If it is an MP4 file, then it should open in the video player.

How to convert a PHP file

Explore jason_encode documentation on PHP.net to learn how to convert PHP arrays in Javascript - code JSON format (JavaScript Object Notation). Such conversion is only possible in PHP 5.2 and higher.

PHP files cannot be converted to multimedia format, such as MP4 or JPG. If you need to download a file, and you know that this file is an image or video, then simply change its extension from PHP to the desired format: MP4 or JPG.

Note

When you rename, you do not convert the file, but give you the opportunity to open it in a suitable program. Before you open a PHP file in your browser, you need to understand that you can do the actual conversion using conversion tools.

What is needed for PHP to work with HTML

PHP code embedded in an HTML file is recognized as PHP rather than HTML if it is enclosed in the following tags:

< ?php [код PHP] ?>

To make a link in an HTML file to PHP file, use the code below, in which instead of footer.php enter the name of your file:

< ?php include "footer.php";?>

Sometimes a web page uses PHP by linking to a URL in which the default PHP file is named index.php. It might look something like this:

http://www.examplesite.com/index.php.

More information on PHP

The official website of this programming language is PHP.net. If you want to learn more about how to work with PHP, you can refer to the full documentation. Good resource also W3Schools.

The first version of PHP was released in 1995 and was called Personal Home Page Tools ( tools for creating personal home pages) or PHP Tools.

Most common using PHP- this is the execution of scripts on the server. In this case it is necessary collaboration PHP parser, browser and server. The browser contacts the server on which it is running software PHP, and displays everything that happens on the server on the page.

Another use is executing scripts command line, when neither the browser nor the server are in use. Similar type PHP implementations useful for automated tasks.

PHPS files are syntax highlighting files. Some PHP servers are configured so that they automatically highlight syntax in files with this extension. This setting can be enabled in the httpd.conf configuration file. You can read more about syntax highlighting, PHP format and how to open it here.

Announcement

PHP Website File Format

PHP is known as a server-side scripting language. It is used in web development. In addition, it is a programming language general purpose. It was created by Rasmus Lerdorf in 1994. The language is currently used on more than 240 million websites. Files with the PHP extension are web pages that contain code in a specified programming language.

Technical information about PHP files

PHP files can contain code that is used to perform various online processes. The PHP engine on the web server parses the PHP code contained in the file and dynamically generates HTML code from it. This is what the user sees when visiting a web page. The underlying PHP code and the corresponding file are not visible to the user.

Additional information about the PHP format

Answers:

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

Axel:
This is the php language file 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 the correct name. If Internet Explorer shows nonsense (it’s better not to open files larger than a few 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.

- Extension (format) is the characters at the end of the file after the last dot.
- The computer determines the file type by its extension.
- By Windows default does not show file name extensions.
- Some characters cannot be used in the file name and extension.
- Not all formats are related to the same program.
- Below are all the programs that can be used to open a PHP file.

Many MS Windows users have long noticed that the standard notepad is a rather inconvenient program to use. This could be a replacement for it. free editor text files, which provides syntax support for a large number of programming languages. The program contains a fairly wide range of options and is characterized by minimal consumption of processor resources. The program makes it possible to simultaneously view several documents at once and edit them, without closing unnecessary windows. An option has also become available: editing the same document in different places, which is very convenient...

Notepad2 is a simple application that allows you to type and edit text. It will help in creating HTML pages, programming in various languages ​​(CSS, Java, JavaScript, Python, SQL, Perl, PHP) as it can highlight code. The program is built on the principle of a simple notepad; it is lightweight and compact. This text editor checks all parentheses for pairs and supports auto-indentation. Notepad2 not only supports ASCII and UTF-8 encodings, but can also convert them. Allows you to roll back unwanted operations many levels back. Supports block selection of text elements and has numbered...

One of best programs creating web applications for WEB 2.0 developers. Includes a convenient and simple interface, convenient HTML, PHP, Ruby, CSS, Python and JavaScript editors, supports HTML5, has a built-in Debugger with a wide range of capabilities, support for various browsers, such as Mozilla Firefox,Opera, Google Chrome, Internet Explorer and Safari, quickly supports all new technologies, such as Adobe AIR and even development for IPhone 5. Help system quite rich and without a doubt this is the right choice for any developer. The program runs on the Eclipse platform and has a lot of plugins for...

Bluefish is a powerful program for programming and web development. It has many functions for developing websites, scripts and program codes. The program runs at high speed and can download hundreds of files in a matter of seconds. Open more than 500+ documents simultaneously without any problems. There are very useful features, How good search by files as well as without limit functions “Undo” and “Redo”. Automatic recovery in case of unplanned shutdown. Integration external programs and external filters. Language support, namely online help information. The program is under development, but already supports 17 languages...

PSPad is a very useful editor program code, suitable for coders who write in multiple languages. Suitable for those who need program code highlighting. Can easily replace popular tools. The PSPad will prove its worth when working with complex code syntax. It was created to help all types of users. The program comes with an impressive list of templates. There are features like syntax highlighting, macro recording, or search and replace functions that are common in such applications. It comes with HEX editor, FTP client, so the user can edit the code directly...

PHP is a server-side scripting language designed specifically for web development. Supports HTML language and is capable of generating and passing information to an HTML file. PHP integrates into many platforms (Windows, Linux, Unix). Its main task is to create active dynamic web pages. It is one of the most user-friendly programming languages. PHP is known for its reliability, speed, stability and enhanced security. Code written in script language PHP is interpreted by a web server and dynamic web pages are generated using the PHP module.

Komodo Edit - convenient editor code that supports a wide range of different programming languages. The program gives users the opportunity to work with several files at once; writing code will become more efficient using the autocomplete function and hints. The application allows you to automatically highlight variables when you select them. Using the editor, you can view files in other programming languages. The program supports syntax coloring and indentation. Can check syntax parameters, snippets used to store source column code. Has a simple editing mode and supports drag and drop...

There are a lot of programs on the Internet that allow you to edit the source code of another program, file, etc. However, most of these programs are just a text editor like Notepad. They differ from the above editor only in that they have syntax highlighting. However, in some cases, this program functionality is not enough. A programmer may need to quickly find different parts of a document. And now, finally, a program has appeared that allows you to solve this problem. The program is called SynWrite. Its distinctive feature is the presence navigation bar with a tree that...

Free Opener is a fairly functional viewer of the most popular files, including Winrar archives, documents Microsoft Office, PDF, Photoshop documents, torrent files, icons, web pages, text documents, audio and video files, graphic files including Flash and much more. The number of supported files exceeds seventy. The program does not have the usual settings and options except for changing the design. It is also necessary to note that there is no Russian language, but given the simplicity, do not underestimate the program. Free Opener is a universal and very convenient program for reading various types of files.

The most common problem that prevents users from opening this file is an incorrectly assigned program. To fix this in Windows OS you need to right-click on the file, in context menu Hover your mouse over the "Open with" item and select "Select a program..." from the drop-down menu. As a result you will see a list installed programs on your computer, and you can choose the appropriate one. We also recommend checking the box next to “Use this application for all PHP files.”

Another problem that our users also encounter quite often is that the PHP file is corrupted. This situation can arise in many cases. For example: the file was downloaded incompletely as a result server errors, the file was damaged initially, etc. To fix this problem, use one of the recommendations:

  • Try to find required file in another source on the Internet. You may have luck finding a more suitable version. Example Google search: "File filetype:PHP" . Just replace the word "file" with the name you want;
  • Ask them to send you the original file again, it may have been damaged during transmission;

File extension .php
File category
Example file (2.58 KiB)
Related programs Adobe Dreamweaver CC 2015
Eclipse PHP Development Tools
Zend Studio
MPSoftware phpDesigner
ES-Computing EditPlus
Blumentals WeBuilder
Notepad++
WampServer
Web browsers