Question: I received a file with the extension .php for a free script. Now I wonder how I can open the file. Is there a special program for?
Answer: In principle, any text editor is suitable for opening PHP files with the extension .php. The endings .php3 and .php4 were also used in the past. However, these have been abolished in favor of the uniform .php ending. If you open the PHP file in a text editor, you can look at the programming code of the file. So you can see the PHP commands.
In practice, these files are uploaded to a web server and the PHP code is then executed there when the file is called. That means, in the text editor you can see these lines, for example:
But the output on the web server would then only be:
Hello world!
On a Windows PC, it is best to use editors such as Notepad ++, Eclipse PDT, Scriptly or Textpad to open the PHP files. On the Mac under OS X, for example, TextEdit (included with the system for free), BBEdit, Dreamweaver or Coda 2 can be used.
If you want to tinker with the scripts, you have to run a web server with a PHP interpreter. There are ready-made solutions for this, such as WampServer (Windows PC) or mamp (Mac OS X).
I hope that I could help you with how and what to do with PHP files. :)
Related Articles
Jens has been running the blog since 2012. He acts as Sir Apfelot for his readers and helps them with technical problems. In his spare time he rides electric unicycles, takes photos (preferably with the iPhone, of course), climbs around in the Hessian mountains or hikes with the family. His articles deal with Apple products, news from the world of drones or solutions to current bugs.